code: private boolean renameOverwrite(String oldname, String newname) {
  
          boolean deleted = delete(newname);
  
          if (exists(oldname)) {
              File file = new File(oldname);
  
              return file.renameTo(new File(newname));
          }
  
          return deleted;
      }
docs: Rename the file with oldname to newname. If a file with newname already
  exists, it is deleted before the renaming operation proceeds.
  
  If a file with oldname does not exist, no file will exist after the
  operation.