code: public static void atomicMove(File source, File dest) throws IOException {
      Files.move(source.toPath(), dest.toPath(), ATOMIC_MOVE, REPLACE_EXISTING);
    }
docs: Atomically move one file to another file.
  
  @param source the source file.
  @param dest the destination file.
  @throws IOException if an I/O error occurs.