List of utility methods to do Folder Delete
void | emptyFolder(File folder) Removes a folder's contents deleteFolder(folder, true); |
int | emptyFolder(File folder, boolean ignoreCannotDel) empty Folder int counter = 0; if (folder.exists() && folder.isDirectory()) { File[] child = folder.listFiles(); for (int i = 0; i < child.length; i++) { File file = child[i]; if (file.isDirectory()) counter += emptyFolder(file, ignoreCannotDel); boolean result = file.delete(); ... |
void | emptyFolder(File toEmpty) empty Folder for (File current : toEmpty.listFiles()) { if (current.isDirectory()) { emptyFolder(current); current.delete(); |
void | emptyFolder(final File folder) empty Folder deleteFolder(folder); if (!folder.mkdirs()) { throw new IOException(String.format("Could not create empty folder %s", folder)); |
boolean | emptyFolder(final File folder) Recursively deletes whole content of the given folder. if (!folder.isDirectory()) { return true; File[] files = folder.listFiles(); boolean result = true; for (int i = 0; i < files.length; i++) { File file = files[i]; if (file.isDirectory()) { ... |