code: public static void deleteFileIfExists(UnderFileSystem ufs, String path) {
      try {
        if (ufs.isFile(path)) {
          ufs.deleteFile(path);
        }
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
docs: Deletes the specified path from the specified under file system if it is a file and exists.
  
  @param ufs instance of {@link UnderFileSystem}
  @param path the path to delete