List of utility methods to do Recursive Delete
void | recursiveDel(final File f) Recursively deletes if (f == null) throw new IllegalArgumentException("The passed file was null"); if (f.isFile()) { f.delete(); } else { for (File x : f.listFiles()) { recursiveDel(x); |
boolean | recursiveDelete(File _f) recursive Delete boolean result = true; File[] dirContent = _f.listFiles(); if (dirContent != null) { for (int i = 0; i < dirContent.length; i++) { if (dirContent[i].isDirectory()) { if (!recursiveDelete(dirContent[i])) { result = false; } else if (!dirContent[i].delete()) { result = false; if (!_f.delete()) { result = false; return result; |
void | recursiveDelete(File base) Recursively deletes all files in the tree rooted at the given path. final List<File> failed = new ArrayList<File>(); recursiveDeleteHelper(base, failed); if (!failed.isEmpty()) { final StringBuilder sb = new StringBuilder("Failed to delete"); for (File f : failed) sb.append(' ').append(f.getAbsolutePath()); throw new IOException(sb.toString()); |
void | recursiveDelete(File dir) Recursive delete. if (dir == null) return; if (dir.isFile()) { dir.delete(); return; File[] entries = dir.listFiles(); if (entries == null) { ... |
File | recursiveDelete(File dir) recursive Delete if (dir.exists()) { if (dir.isDirectory()) { for (String fname : dir.list()) { File ff = new File(dir, fname); recursiveDelete(ff); if (!dir.delete()) { ... |
void | recursiveDelete(File dir) Recursively deletes everything under dir if (dir.isFile()) { dir.delete(); } else if (dir.isDirectory()) { File[] entries = dir.listFiles(); for (int i = 0; i < entries.length; i++) { if (entries[i].isDirectory()) { recursiveDelete(entries[i]); entries[i].delete(); dir.delete(); |
boolean | recursiveDelete(File dir, boolean deleteBase) Recursively delete the directory structure from this directory down, including this directory. boolean status = true; if (!dir.isDirectory()) return false; File listing[] = dir.listFiles(); for (int i = 0; i < listing.length; i++) { File file = listing[i]; if (file.isDirectory()) status &= deleteR(file); ... |
void | recursiveDelete(File dirPath) Utilities for Files. String[] ls = dirPath.list(); for (int idx = 0; idx < ls.length; idx++) { File file = new File(dirPath, ls[idx]); if (file.isDirectory()) { recursiveDelete(file); file.delete(); |
boolean | recursiveDelete(File f) Deletes the given dir and all files/dirs underneath String defSaveDir = null; String moveToDir = null; try { moveToDir = new File(moveToDir).getCanonicalPath(); } catch (Throwable e) { try { defSaveDir = new File(defSaveDir).getCanonicalPath(); ... |
void | recursiveDelete(File f) recursiveDelete just recursively deletes a dir - you'd think Java would have something to do this?? if (f.isDirectory()) { File fs[] = f.listFiles(); for (File subf : fs) { recursiveDelete(subf); if (!f.delete()) { throw new IOException("could not delete: " + f.getPath()); ... |