sources = expandCopySources(sources);
if (sources.length == 0) {
return SVNCommitInfo.NULL;
}
try {
return setupCopy(sources, new SVNPath(dst.toString()), isMove, makeParents, commitMessage,
revisionProperties, getCommitHandler(), getCommitParameters(), getExternalsHandler());
} catch (SVNException e) {
SVNErrorCode err = e.getErrorMessage().getErrorCode();
if (!failWhenDstExists && sources.length == 1 && (err == SVNErrorCode.ENTRY_EXISTS || err == SVNErrorCode.FS_ALREADY_EXISTS)) {
SVNCopySource source = sources[0];
String baseName = source.getName();
if (!source.isURL()) {
baseName = SVNEncodingUtil.uriEncode(baseName);
}
try {
return setupCopy(sources, new SVNPath(dst.appendPath(baseName, true).toString()), isMove,
makeParents, commitMessage, revisionProperties, getCommitHandler(), getCommitParameters(), getExternalsHandler());
} catch (SVNException second) {
throw second;
}
}