List of utility methods to do Delete Tree
void | delTree(File f) Delete directory tree. delTree(f, true, null); |
void | delTree(File file) del Tree if (file.isFile()) { file.delete(); return; if (file.isDirectory()) { for (File f : file.listFiles()) delTree(f); file.delete(); |
boolean | delTree(File file) Delete either the supplied file or all files within the directory supplied or any sub-directories. if (file.isFile()) { return file.delete(); File[] list = file.listFiles(); for (int i = 0; i < list.length; i++) { if (!delTree(list[i])) { return false; return true; |
void | delTree(File file) Recursively deletes all contents of the given directory. if (!file.exists()) return; File[] fileList; if ((fileList = file.listFiles()) != null) { for (File f : fileList) { if (f.isDirectory()) delTree(f); else ... |
boolean | delTree(File file) del Tree if (file.isFile()) { return file.delete(); } else { String[] list = file.list(); for (int i = 0; i < list.length; i++) { if (!delTree(new File(file, list[i]))) { return false; return true; |
void | delTree(File file) Delete a directory tree recursively. File[] files = file.listFiles(); if (files != null) { for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { delTree(files[i]); files = file.listFiles(); if (files != null) { for (int i = 0; i < files.length; i++) { files[i].delete(); |
boolean | delTree(File file) Delete a directory recursively or delete a single file if (file.exists()) { if (file.isDirectory()) { File[] files = file.listFiles(); for (int i = 0; files != null && i < files.length; i++) { if (!delTree(files[i])) { return false; if (!file.delete()) { return false; } else { if (file.exists()) { return false; return true; } else { return false; |
void | delTree(File root) Delete an entire tree with files, subdirectories, etc. if (!root.isDirectory()) throw new IllegalArgumentException("Not a directory: " + root); for (File f : root.listFiles()) { if (f.isDirectory()) delTree(f); else f.delete(); root.delete(); |
void | deltree(File root) Purges the passed file. if (root == null || !root.exists()) return; if (root.isDirectory()) { for (File subRoot : root.listFiles()) { if (subRoot.isFile()) { subRoot.delete(); } else { deltree(subRoot); ... |
void | deltree(final String directory) Delete a directory and its sub-files deltree(new File(directory));
|