List of utility methods to do Directory Clear
void | cleanDirectory(String dirPath) clean Directory cleanDirectory(new File(dirPath));
|
void | clearDirctory(File dir) clear Dirctory deleteR(dir, false); |
void | clearDirectory(File dir) clear Directory for (File f : dir.listFiles()) {
delete(f);
|
void | clearDirectory(File dir) clear Directory if (!dir.isDirectory()) { return; for (File subFile : dir.listFiles()) { if (subFile.isFile()) { if (!subFile.delete()) { throw new IOException("Can not delete \"" + subFile.getAbsolutePath() + "\"."); } else if (subFile.isDirectory()) { removeDirectory(subFile); |
void | clearDirectory(File dir, boolean doTree) Delete every file within a directory. String[] fileList = dir.list(); if (fileList == null) { return; for (int ii = 0; ii < fileList.length; ii++) { File subFile = new File(dir, fileList[ii]); if (subFile.isDirectory()) { if (doTree) { ... |
void | clearDirectory(File f) clear Directory if (!f.isDirectory()) { throw new IllegalArgumentException("Only directory can be cleared."); for (File c : f.listFiles()) { delete(c); |
void | clearDirectory(File f) clear Directory if (f.isDirectory()) { File[] entries = f.listFiles(); for (int i = 0; i < entries.length; i++) { deleteRecursive(entries[i]); |
void | clearDirectory(File src) Deletes all files in the directory, recursively deleting sub-directories of this directory. if (src.exists() && src.isDirectory()) { for (File file : src.listFiles()) { if (file.isDirectory()) { deleteRecursive(file); } else { if (!file.delete()) { throw new IOException("Could not delete: " + file); |
void | clearDirectory(String absolutePath) delete all files in specified path clearDirectory(new File(absolutePath));
|
void | clearDirectory(String dir) clear Directory File f = new File(dir); if (!f.exists()) { throw new IOException("Directory not present or not writable"); if (f.isDirectory()) { deleteFolder(f); } else { throw new IOException("Is not a directory"); ... |