@Override public void moveTo(FilePath newName, boolean atomicReplace) { base.moveTo(((FilePathWrapper) newName).base, atomicReplace); }
/** * Rename a file if this is allowed, and try to atomically replace an * existing file. This method is similar to Java 7 * <code>java.nio.file.Files.move</code>. * * @param source the old fully qualified file name * @param target the new fully qualified file name */ public static void moveAtomicReplace(String source, String target) { FilePath.get(source).moveTo(FilePath.get(target), true); }
/** * Rename a file if this is allowed. This method is similar to Java 7 * <code>java.nio.file.Files.move</code>. * * @param source the old fully qualified file name * @param target the new fully qualified file name */ public static void move(String source, String target) { FilePath.get(source).moveTo(FilePath.get(target), false); }
@Override public void moveTo(FilePath path, boolean atomicReplace) { FilePathSplit newName = (FilePathSplit) path; for (int i = 0;; i++) { FilePath o = getBase(i); if (o.exists()) { o.moveTo(newName.getBase(i), atomicReplace); } else { break; } } }