code: public static boolean rename(File pFrom, File pTo, boolean pOverWrite) throws IOException {
          if (!pFrom.exists()) {
              throw new FileNotFoundException(pFrom.getAbsolutePath());
          }
  
          if (pFrom.isFile() && pTo.isDirectory()) {
              pTo = new File(pTo, pFrom.getName());
          }
          return (pOverWrite || !pTo.exists()) && pFrom.renameTo(pTo);
  
      }
docs: Renames the specified file.
  If the destination is a directory (and the source is not), the source
  file is simply moved to the destination directory.
  
  @param pFrom      The file to rename
  @param pTo        The new file
  @param pOverWrite Specifies if the tofile should be overwritten, if it
  exists
  @return {@code true}, if the file was renamed.
  
  @throws FileNotFoundException if {@code pFrom} does not exist.