Permanently deletes a trashed file.
@param fileID the ID of the trashed folder to permanently delete.
488895
public void deleteFile(String fileID) {
        URL url = FILE_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), fileID);
        BoxAPIRequest request = new BoxAPIRequest(this.api, url, "DELETE");
        BoxAPIResponse response = request.send();
        response.disconnect();
    }
555988
public static void deleteIfExists(final File file)
    {
        if (file.exists())
        {
            try
            {
                Files.delete(file.toPath());
            }
            catch (final IOException ex)
            {
                LangUtil.rethrowUnchecked(ex);
            }
        }
    }
114335
private void delete(File file) {
		if (file.isDirectory()) {
			File[] children = file.listFiles();
			for (File child : children) {
				delete(child);
			}
		}
		if (!file.delete()) {
			if (!file.isDirectory()) {
				logger.warn("Unable to clean/delete file: {}", file);
			} else {
				logger.debug("Unable to clean/delete directory: {}", file);
			}
		}
	}
1291475
@Override
  public void deletePage(int pageID) {
    try {
      // / put id to empty nodes and
      // delete from cache
      super.deletePage(pageID);

      // delete from file
      countWrite();
      byte[] array = pageToByteArray(null);
      file.getRecordBuffer(pageID).put(array);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
559719
public static boolean deleteFile(File file) {
        if (file.exists()) {
            if (file.isDirectory()) {
                try {
                    deleteDirectory(file);
                    return true;
                } catch (IOException e) {
                    logger.error(e.getMessage());
                    return false;
                }
            } else {
                return file.delete();
            }
        }
        return false;
    }
289091
function(id, chunkIdx) {
            var fileState = handler._getFileState(id);

            if (fileState) {
                delete fileState.temp.cachedChunks[chunkIdx];
            }
        }
1267244
private void resetFile(String file) {
    File f = new File(file);
    if (f.exists()) {
      JMetalLogger.logger.info("Already existing file " + file);

      if (f.isDirectory()) {
        JMetalLogger.logger.info("Deleting directory " + file);
        if (f.delete()) {
          JMetalLogger.logger.info("Directory successfully deleted.");
        } else {
          JMetalLogger.logger.info("Error deleting directory.");
        }
      } else {
        JMetalLogger.logger.info("Deleting file " + file);
        if (f.delete()) {
          JMetalLogger.logger.info("File successfully deleted.");
        } else {
          JMetalLogger.logger.info("Error deleting file.");
        }
      }
    } else {
      JMetalLogger.logger.info("File " + file + " does NOT exist.");
    }
  }
453843
@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;
    }
902518
public static void deleteDirectory(File directory) throws IOException {
    requireNonNull(directory, DIRECTORY_CAN_NOT_BE_NULL);

    if (!directory.exists()) {
      return;
    }

    Path path = directory.toPath();
    if (Files.isSymbolicLink(path)) {
      throw new IOException(format("Directory '%s' is a symbolic link", directory));
    }
    if (directory.isFile()) {
      throw new IOException(format("Directory '%s' is a file", directory));
    }
    deleteDirectoryImpl(path);

    if (directory.exists()) {
      throw new IOException(format("Unable to delete directory '%s'", directory));
    }
  }
591295
public void delete() {
    try {
      getDFS().delete(this.path, true);

    } catch (IOException e) {
      e.printStackTrace();
      MessageDialog.openWarning(null, "Delete file",
          "Unable to delete file \"" + this.path + "\"\n" + e);
    }
  }
178443
public static void deleteFileOrDirectory(File file) {
    if (!file.isDirectory()) {
      file.delete();
      return;
    }

    if (file.list().length == 0) { //Nothing under directory. Just delete it.
      file.delete();
      return;
    }

    for (String temp : file.list()) { //Delete files or directory under current directory.
      File fileDelete = new File(file, temp);
      deleteFileOrDirectory(fileDelete);
    }
    //Now there is nothing under directory, delete it.
    deleteFileOrDirectory(file);
  }
663798
public static void recursivelyDeleteDirectoryOnExit(final File directory) {
    Runtime.getRuntime().addShutdownHook(new Thread() {
      @Override
      public void run() {
        try {
          recursivelyDeleteDirectory(directory);
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
    });
  }
905434
private static void recursiveDelete(File f) throws IOException
   {
      if (f != null && f.exists())
      {
         File[] files = f.listFiles();
         if (files != null)
         {
            for (int i = 0; i < files.length; i++)
            {
               if (files[i].isDirectory())
               {
                  recursiveDelete(files[i]);
               }
               else
               {
                  if (!files[i].delete())
                     throw new IOException("Could not delete " + files[i]);
               }
            }
         }
         if (!f.delete())
            throw new IOException("Could not delete " + f);
      }
   }
518027
public static void deleteDirRecursive(File dir) throws IOException {
        File failed = deleteDirRecursiveInternal(dir, true);
        if (failed != null) {
            throw new IOException("Could not delete file: " + failed.getPath());
        }
    }
817785
public void setFilesDeleted(java.util.Collection<FileMetadata> filesDeleted) {
        if (filesDeleted == null) {
            this.filesDeleted = null;
            return;
        }

        this.filesDeleted = new java.util.ArrayList<FileMetadata>(filesDeleted);
    }
167847
private boolean deleteFile(String filename) throws Exception {
        if (filename == null) {
            return false;
        }
        File file = new File(storeDir, filename);
        return Files.deleteIfExists(file.toPath());
    }
751497
private boolean delete(final File f) throws IOException {

		if (f.isDirectory()) {
			final File[] files = f.listFiles();
			if (files != null) {
				for (File file : files) {
					final boolean del = delete(file);
					if (!del) {
						return false;
					}
				}
			}
		} else {
			return f.delete();
		}

		// Now directory is empty
		return f.delete();
	}