List of utility methods to do Directory Delete
boolean | emptyDir(File dir) Delete the contents of a directory, leaving the empty directory. String files[] = dir.list(); if (files == null) { return false; boolean ret = true; for (int i = 0; i < files.length; i++) { File f = new File(dir, files[i]); if (f.isDirectory()) { ... |
void | emptyDir(File dir) empty Dir if (!(dir.exists() && dir.canWrite())) { throw new IOException( "Kann Verzeichnis nicht leeren, es ist nicht vorhanden " + "oder nicht beschreibbar"); if (dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { File current = new File(dir, children[i]); ... |
boolean | emptyDir(File dir) Deletes all files and subdirectories under dir. if (dir.isDirectory()) { for (File child : dir.listFiles()) { boolean success = deleteDir(child); if (!success) { return false; return true; |
void | emptyDir(File dir) empty Dir if (dir.isDirectory()) { String[] files = dir.list(); if (files != null) { for (int i = 0; i < files.length; i += 1) { new File(dir, files[i]).delete(); } else { ... |
void | emptyDir(File dir) empty Dir File[] files = dir.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { emptyDir(files[i]); files[i].delete(); |
void | emptyDir(File directory) empty Dir if (directory.exists() && directory.isDirectory()) { File[] contents = directory.listFiles(); for (File file : contents) { if (file.isDirectory()) { emptyDir(file); file.delete(); } else { file.delete(); ... |
boolean | emptyDir(String dirName) empty Dir boolean result = false; File dir = new File(dirName); if (dir != null && dir.isDirectory()) { File[] files = dir.listFiles(); result = files.length == 0 ? true : false; return result; |
void | emptyDir(String path) empty Dir File dir = new File(path); assert dir.isDirectory(); for (File file : dir.listFiles()) { delete(file); |
void | emptyDirectory(File dir) empty Directory for (File f : dir.listFiles()) {
f.delete();
|
void | emptyDirectory(File dir) empty Directory File[] files = dir.listFiles(); if (files == null) { return; int len = files.length; for (int i = 0; i < len; i++) { File file = files[i]; if (file.isDirectory()) { ... |