List of utility methods to do Delete File Recursively
void | deleteRecursive(File src) Deletes the file, recursively scanning sub-directories if its a directory. clearDirectory(src); if (src.exists() && !src.delete()) { throw new IOException("Could not delete: " + src); |
void | deleteRecursive(File src, List delete Recursive if (!src.exists()) throw new IOException("File/directory does not exist: " + src); if (excludes == null || !excludes.contains(src)) { if (src.isFile()) { if (!src.delete()) throw new IOException("Cannot delete file: " + src); } else { for (File srcFile : src.listFiles()) { ... |
void | deleteRecursive(File toDelete) delete Recursive if (toDelete.isFile()) { toDelete.delete(); } else if (toDelete.isDirectory()) { for (File f : toDelete.listFiles()) { deleteRecursive(f); |
void | deleteRecursive(File toDelete) This method acts much like bash's "rm -rf $file" command. for (File sub : toDelete.listFiles()) { if (sub.isDirectory()) { deleteRecursive(sub); } else { if (!sub.delete()) { throw new IOException(); |
boolean | deleteRecursive(final File dir) delete Recursive boolean ret = true; if (dir.isDirectory()) { final String[] entries = dir.list(); for (final String entry : entries) { final File actFile = new File(dir.getPath(), entry); ret &= deleteRecursive(actFile); return (ret & dir.delete()); |
boolean | deleteRecursive(final File file) Deletes a file or directory. boolean result = true; if (file.isDirectory()) { for (final File inner : file.listFiles()) { result &= deleteRecursive(inner); return result & file.delete(); |
boolean | deleteRecursive(final File file) delete Recursive boolean ok = true; if (file.exists()) { if (file.isDirectory()) { for (File child : file.listFiles()) ok &= deleteRecursive(child); ok &= file.delete(); return ok; |
void | deleteRecursive(final File file) Rekursives l?schen von Dateien und Verzeichnissen if (file == null) return; if (file.isDirectory()) { final File[] files = file.listFiles(); for (int i = 0; i < files.length; i++) deleteRecursive(files[i]); file.delete(); ... |
boolean | deleteRecursive(final File file, final boolean collect) delete Recursive boolean result = true; if (collect && isWindows()) { System.gc(); File[] children = file.listFiles(); if (children != null) { for (File sf : children) { if (sf.isDirectory()) { ... |
boolean | deleteRecursiveDir(File directory) Delete the directory and its subdirs associated with the File as path if empty if (directory == null) { return true; boolean retour = true; if (!directory.exists()) { return true; if (!directory.isDirectory()) { ... |