updateCopiedDirectory(dstAccess.getTarget(), "", newURL, null, -1); SVNEntry newRoot = dstAccess.getTarget().getEntries().getEntry("");
updateCopiedDirectory(newDir, "", newURL, null, -1); SVNEntry newRoot = newDir.getEntries().getEntry("");
    private void copyDirectory(SVNWCAccess dstAccess, SVNWCAccess srcAccess, String dstName) throws SVNException {        SVNEntry srcEntry = dstAccess.getTarget().getEntries().getEntry("");        if (srcEntry == null) {            SVNErrorManager.error("svn: '" + srcAccess.getTarget().getRoot() + "' is not under version control");        } else if (srcEntry.isScheduledForDeletion() || srcEntry.getURL() == null || srcEntry.isCopied()) {            SVNErrorManager.error("svn: Cannot copy or move '" + srcAccess.getTarget().getRoot() + "': it is in repository yet; try committing first");        }        String copyFromURL = srcAccess.getTargetEntryProperty(SVNProperty.URL);        long copyFromRev = SVNRevision.parse(srcAccess.getTargetEntryProperty(SVNProperty.REVISION)).getNumber();        String newURL = dstAccess.getAnchor().getEntries().getEntry("").getURL();        newURL = PathUtil.append(newURL, PathUtil.encode(dstName));        try {            SVNFileUtil.copyDirectory(srcAccess.getTarget().getRoot(), dstAccess.getTarget().getRoot());        } catch (IOException e) {            SVNErrorManager.error(0, e);        }        dstAccess.addDirectory(dstName, dstAccess.getTarget().getRoot(), true, true);        SVNEntry entry = dstAccess.getAnchor().getEntries().addEntry(dstName);        entry.setCopyFromRevision(copyFromRev);        entry.setKind(SVNNodeKind.DIR);        entry.scheduleForAddition();        entry.setCopyFromURL(copyFromURL);        entry.setCopied(true);        dstAccess.getTarget().getEntries().save(true);        updateCopiedDirectory(dstAccess.getTarget(), "", newURL, null, -1);        SVNEntry newRoot = dstAccess.getTarget().getEntries().getEntry("");        newRoot.scheduleForAddition();        newRoot.setCopyFromRevision(copyFromRev);        newRoot.setCopyFromURL(copyFromURL);        dstAccess.getTarget().getEntries().save(true);    }