String childCopyFromURL = copyFromURL == null ? null : PathUtil.append(copyFromURL, PathUtil.encode(entry.getName())); updateCopiedDirectory(childDir, "", newURL, childCopyFromURL, copyFromRevision);
if (childDir != null) { String childCopyFromURL = copyFromURL == null ? null : PathUtil.append(copyFromURL, PathUtil.encode(entry.getName())); updateCopiedDirectory(childDir, "", newURL, childCopyFromURL, copyFromRevision); }
    private void updateCopiedDirectory(SVNDirectory dir, String name, String newURL, String copyFromURL, long copyFromRevision) throws SVNException {        SVNEntries entries = dir.getEntries();        SVNEntry entry = entries.getEntry(name);        if (entry != null) {            entry.setCopied(true);            if (newURL != null) {                entry.setURL(newURL);            }            if (entry.isFile()) {                dir.getWCProperties(name).delete();                if (copyFromURL != null) {                    entry.setCopyFromURL(copyFromURL);                    entry.setCopyFromRevision(copyFromRevision);                }            }            boolean deleted = false;            if (entry.isDeleted() && copyFromURL != null) {                // convert to scheduled for deletion.                deleted = true;                entry.setDeleted(false);                entry.scheduleForDeletion();                if (entry.isDirectory()) {                    entry.setKind(SVNNodeKind.FILE);                }            }            if (entry.getLockToken() != null && copyFromURL != null) {                entry.setLockToken(null);                entry.setLockOwner(null);                entry.setLockComment(null);                entry.setLockCreationDate(null);            }            if (!"".equals(name) && entry.isDirectory() && !deleted) {                SVNDirectory childDir = dir.getChildDirectory(name);                String childCopyFromURL = copyFromURL == null ? null : PathUtil.append(copyFromURL, PathUtil.encode(entry.getName()));                updateCopiedDirectory(childDir, "", newURL, childCopyFromURL, copyFromRevision);            } else if ("".equals(name)) {                dir.getWCProperties("").delete();                if (copyFromURL != null) {                    entry.setCopyFromURL(copyFromURL);                    entry.setCopyFromRevision(copyFromRevision);                }                for (Iterator ents = entries.entries(); ents.hasNext();) {                    SVNEntry childEntry = (SVNEntry) ents.next();                    if ("".equals(childEntry.getName())) {                        continue;                    }                    String childCopyFromURL = copyFromURL == null ? null : PathUtil.append(copyFromURL, PathUtil.encode(childEntry.getName()));                    String newChildURL = newURL == null ? null :  PathUtil.append(newURL, PathUtil.encode(childEntry.getName()));                    updateCopiedDirectory(dir, childEntry.getName(), newChildURL, childCopyFromURL, copyFromRevision);                }                entries.save(true);            }        }    }