List of utility methods to do Folder Delete
void | clearDir(File d) clear Dir File[] kids = d.listFiles(); if (kids != null) { for (File kid : kids) { if (kid.isDirectory()) { clearDir(kid); if (!kid.delete()) { throw new IOException(kid.getAbsolutePath()); ... |
boolean | clearDir(File dir) clear Dir if (!dir.exists()) { return false; for (File file : dir.listFiles()) { if (file.isDirectory()) { clearDir(file); if (!file.delete()) ... |
void | clearDir(File dir) clear Dir for (File f : dir.listFiles()) { if (f.isDirectory()) { clearDir(f); f.delete(); |
boolean | clearDir(File dir) Deletes all sub-files and sub-directories in the given directory. if (!dir.isDirectory()) return false; File[] files = dir.listFiles(); if (files == null || files.length == 0) return true; boolean cleared = true; for (File sub : files) { cleared &= delete(sub); ... |
boolean | clearDir(File dir) clear Dir if (!dir.isDirectory()) return false; File[] files = dir.listFiles(); if (files == null || files.length == 0) return true; boolean cleared = true; for (File sub : files) { cleared &= delete(sub); ... |
void | clearFiles(File dir) Clears a directory of all its files. File[] files = dir.listFiles(); for (int i = 0; i < files.length; i++) files[i].delete(); |
boolean | clearFilesOnPath(String path) clear Files On Path File dir = new File(path); if (!dir.exists()) { System.out.println(path + " does not exists"); return false; if (!dir.isDirectory()) { System.out.println(path + " is not directory"); return false; ... |
void | clearFolder(File f) clear Folder if (f.isDirectory()) { for (File c : f.listFiles()) delete(c); |
void | clearFolder(File[] children) clear Folder for (int i = 0; i < children.length; i++) { File[] second = children[i].listFiles(); if (second != null && second.length > 0) clearFolder(second); children[i].delete(); |
void | clearFolder(String directoryLocation) Deleet all the files from the specified location File fDir = new File(directoryLocation); File[] files = fDir.listFiles(); if (files != null) { for (File aFile : files) { aFile.delete(); |