List of utility methods to do Delete File Recursively
void | deleteR(File dir) delete R deleteR(dir, true); |
void | deleteRec(File f) Delete a file and all subfiles. if (f.isDirectory()) { File[] kids = f.listFiles(); if (kids == null) { throw new IOException("List " + f); for (File kid : kids) { deleteRec(kid); if (!f.delete()) { throw new IOException("Delete " + f); |
boolean | deleteRecursive(File dir) Loescht ein Verzeichnis rekursiv. File candir = dir.getCanonicalFile(); if (!candir.equals(dir.getAbsoluteFile())) return false; File[] files = candir.listFiles(); if (files != null) { for (int i = 0; i < files.length; ++i) { boolean deleted = files[i].delete(); if (!deleted) { ... |
boolean | deleteRecursive(File dir) Deletes the content of a directory completely. if (dir.isFile() || (dir.listFiles().length == 0)) { dir.delete(); return true; for (File f : dir.listFiles()) { deleteRecursive(f); return dir.delete(); ... |
boolean | deleteRecursive(File dir) Recursively deletes an entire directory hierarchy. if (!dir.exists()) return (true); boolean success = true; String files[] = dir.list(); if (files != null) { for (int i = 0; i < files.length; i++) { File file = new File(dir, files[i]); if (file.isDirectory()) ... |
void | deleteRecursive(File dir) delete Recursive if (!dir.exists()) return; deleteContentsRecursive(dir); if (!dir.delete()) throw new IOException("Unable to delete " + dir); |
boolean | deleteRecursive(File dir) Deletes everything under a directory (including subdirectories) if (!dir.exists()) { return true; File tempFile; File[] fileList = dir.listFiles(); int fileListLength = fileList.length; int index; boolean result = false; ... |
void | deleteRecursive(File f) Deletes all the file/directory and all of its children if (f.isDirectory()) { for (File c : f.listFiles()) deleteRecursive(c); if (!f.delete()) throw new RuntimeException("Failed to delete file: " + f); |
void | deleteRecursive(File f) delete Recursive if (f.isDirectory()) { File[] entries = f.listFiles(); for (int i = 0; i < entries.length; i++) { deleteRecursive(entries[i]); f.delete(); |
void | deleteRecursive(File f) Recursively delete a directory / file For safety this method only deletes files created under the workspace if (!f.getAbsolutePath() .startsWith(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile().getAbsolutePath())) { throw new IllegalArgumentException("File must exist within the workspace!"); if (f.isDirectory()) { for (File f1 : f.listFiles()) { deleteRecursive(f1); f.delete(); |