code: public static boolean delete(File file) {
  
          if (file == null) {
              return false;
          } else if (!file.isFile()) {
              return false;
          }
  
          return file.delete();
      }
docs: Deletes a file.
  
  @param file A file to delete.
  
  @return <code>true</code> if the file was deleted, otherwise
  <code>false</code>.