List of utility methods to do Recursive Delete
boolean | recursiveDelete(File parent) recursive Delete if (parent.exists()) { if (parent.isDirectory()) { File[] files = parent.listFiles(); for (int ifile = 0; ifile < files.length; ++ifile) { if (files[ifile].isDirectory()) { recursiveDelete(files[ifile]); if (files[ifile].exists()) { ... |
boolean | recursiveDelete(File pathToFolderOrFile) Deletes file or folder. if (pathToFolderOrFile.isFile() && pathToFolderOrFile.exists()) { pathToFolderOrFile.delete(); } else if (pathToFolderOrFile.exists()) { File[] files = pathToFolderOrFile.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { recursiveDelete(files[i]); } else { ... |
void | recursiveDelete(File root) Recursively delete a file and all its contents. if (root == null) { return; if (root.isDirectory()) { File[] files = root.listFiles(); if (files != null) { for (int i = 0; i < files.length; i++) { File file = files[i]; ... |
boolean | recursiveDelete(File root) recursive Delete if (root == null) { return true; boolean ok = true; if (root.isDirectory()) { final File[] files = root.listFiles(); for (File file : files) { ok &= recursiveDelete(file); ... |
void | recursiveDelete(File rootDir, boolean deleteRoot) recursive Delete if ((rootDir == null) || !rootDir.isDirectory()) { return; File[] childDirs = rootDir.listFiles(); if (childDirs != null) { for (File f : childDirs) { if (f.isDirectory()) { recursiveDelete(f, false); ... |
boolean | recursiveDelete(File target) recursive Delete if (target.isDirectory()) { for (File f : target.listFiles()) recursiveDelete(f); return target.delete(); |
void | recursiveDelete(final File directory) Little test utility to help tests that create multiple levels of subdirectories clean up after themselves. for (final File f : directory.listFiles()) { if (f.isDirectory()) { recursiveDelete(f); f.delete(); |
void | recursiveDelete(final File file, final boolean childrenOnly) Deletes a file or recursively deletes a directory. recursiveDelete(file, childrenOnly, null); |
boolean | recursiveDelete(final File fileOrDir) Recursively delete file or directory if (fileOrDir == null) { return false; if (fileOrDir.isDirectory()) { for (File innerFile : fileOrDir.listFiles()) { if (!recursiveDelete(innerFile)) { return false; return fileOrDir.delete(); |
boolean | recursiveDelete(final File path) Recursively delete the given path, stopping on the first error. if (path.isDirectory()) { String[] children = path.list(); if (children == null) { return false; for (int i = 0; i < children.length; i++) { if (!recursiveDelete(new File(path, children[i]))) { return false; ... |