code: @NotNull
      public static boolean delete(@Nullable File file) {
          if (file == null) {
              LOGGER.warn("cannot delete null File");
              return false;
          }
  
          final boolean success = org.apache.commons.io.FileUtils.deleteQuietly(file);
          if (!success) {
              LOGGER.debug("Failed to delete file: {}; attempting to delete on exit.", file.getPath());
              file.deleteOnExit();
          }
          return success;
      }
docs: Deletes a file. If the File is a directory it will recursively delete the
  contents.
  
  @param file the File to delete
  @return true if the file was deleted successfully, otherwise false