List of utility methods to do Delete Tree
void | deltree(String dir) Deletes the directory and its content. String sep = System.getProperty("file.separator"); File directory = new File(dir); if (!directory.exists()) return; if (!directory.isDirectory()) { directory.delete(); String[] files = directory.list(); ... |
boolean | deltree(String dir) deltree File f = new File(dir); if (f.isDirectory()) { File[] files = f.listFiles(); for (File ff : files) deltree(ff.getAbsolutePath()); return f.delete(); |
void | deltree(String directory) Recursive delete of a directory and all it's content deltree(new File(directory));
|
void | delTree(String dirName, String excludedDirName) Recursive utility function that delete entire directory. File dir = new File(dirName); File[] files = dir.listFiles(); if (files != null) { for (int i = 0; i < files.length; i++) { if (files[i].isFile()) files[i].delete(); else { if (excludedDirName != null ... |