List of utility methods to do Delete Directory
void | deleteFiles(File[] intermediateFiles) delete Files for (int i = 0; i < intermediateFiles.length; i++) { if (!intermediateFiles[i].delete()) { throw new IOException("Problem while deleting intermediate file"); |
void | deleteFiles(FileFilter filter) delete Files File[] files = workingDir.listFiles(filter);
for (File f : files) {
f.delete();
|
void | deleteFiles(final ArrayList delete Files if (files == null) return; for (int i = 0; i < files.size(); i++) { File file = files.get(i); if (file == null) continue; deleteFile(file); |
File[] | deleteFiles(final File directory, final String regexPattern) delete Files final Pattern pattern = Pattern.compile(regexPattern); final Collection<File> deletedFiles = new ArrayList<>(); final File[] files = directory.listFiles(); if (files == null) { throw new IllegalArgumentException(directory + " is not a directory"); for (final File file : files) { if (pattern.matcher(file.getName()).find()) { ... |
boolean | deleteFiles(final File file) Utility function for deleting the files in a given directory and the directory itself. boolean ok = true; if (file != null) { if (file.isDirectory()) { final File[] files = file.listFiles(); if (files != null) { for (final File f : files) { if (f.isFile()) { ok &= f.delete(); ... |
void | deleteFiles(final File... files) Delete a list of files, and write a warning message if one could not be deleted. for (final File f : files) { if (!f.delete()) { System.err.println("Could not delete file " + f); |
List | deleteFiles(List This deletes the files in the given list. List<File> notDeleted = new ArrayList<File>(); for (File f : files) { if (!f.delete()) { notDeleted.add(f); return notDeleted; |
boolean | deleteFiles(String dir) delete Files boolean success = false; File dirs = new File(dir); if (dirs.exists() && dirs.isDirectory()) { for (File f : dirs.listFiles()) { if (f.exists()) f.delete(); success = true; ... |
void | deleteFiles(String dir, String... files) delete Files if (!dir.endsWith(File.separator)) { dir += File.separator; for (String file : files) { new File(dir + file).delete(); |
int | deleteFiles(String directory, FileFilter filter, boolean recursive) Removes all files in the given directory matching the given filter return deleteFiles(new File(directory), filter, recursive); |