ifdef renameFile_useNIO endifdef static boolean renameFile(File a, File b) { if (!a.exists()) fail("Source file not found: " + f2s(a)); if (b.exists()) fail("Target file exists: " + f2s(b)); mkdirsForFile(b); ifdef renameFile_useNIO Files.move(a.toPath(), b.toPath()); endifdef ifndef renameFile_useNIO ret a.renameTo(b); endifndef }