target.getPath()); if (!isRoot(target) && targetResult.getPathType() != NOT_FOUND) { if (!contains(options, StandardCopyOption.REPLACE_EXISTING)) {
target.getPath()); if (!isRoot(target) && targetResult.getPathType() != NOT_FOUND) { if (!contains(options, StandardCopyOption.REPLACE_EXISTING)) {
private void copyAsset(final JGitPathImpl source, final JGitPathImpl target) { final Pair<PathType, ObjectId> sourceResult = checkPath(source.getFileSystem().gitRepo(), source.getRefTree(), source.getPath()); final Pair<PathType, ObjectId> targetResult = checkPath(target.getFileSystem().gitRepo(), target.getRefTree(), target.getPath()); if (!isRoot(target) && targetResult.getK1() != NOT_FOUND) { throw new FileAlreadyExistsException(target.toString()); } if (sourceResult.getK1() == NOT_FOUND) { throw new NoSuchFileException(target.toString()); } if (sourceResult.getK1() == DIRECTORY) { copyDirectory(source, target); return; } copyFile(source, target); }
private void copyAssetContent(final JGitPathImpl source, final JGitPathImpl target, final CopyOption... options) { final PathInfo sourceResult = source.getFileSystem().getGit().getPathInfo(source.getRefTree(), source.getPath()); final PathInfo targetResult = target.getFileSystem().getGit().getPathInfo(target.getRefTree(), target.getPath()); if (!isRoot(target) && targetResult.getPathType() != NOT_FOUND) { if (!contains(options, StandardCopyOption.REPLACE_EXISTING)) { throw new FileAlreadyExistsException(target.toString()); } } if (sourceResult.getPathType() == NOT_FOUND) { throw new NoSuchFileException(target.toString()); } if (sourceResult.getPathType() == DIRECTORY) { copyDirectory(source, target, options); return; } copyFile(source, target, options); }