code: public static void rename(String from, String to) {
          try {
              Files.move(Paths.get(from), Paths.get(to), StandardCopyOption.REPLACE_EXISTING);
          } catch (IOException e) {
              log.error("Error renaming file", e);
          }
      }
docs: Rename a file natively; using REN on Windows and mv on *nix.
  
  @param from
  old name
  @param to
  new name