List of utility methods to do Directory Clean
void | cleanDir(File dir) Delete everything inside a directory. if (Thread.interrupted()) { throw new InterruptedException(); if (!dir.exists()) { return; for (File f : dir.listFiles()) { if (f.isDirectory()) { ... |
void | cleanDir(File dir) Cleans a directory, deleting all of its contents. if (!dir.isDirectory()) { throw new IllegalStateException("Directory does not exist: " + dir); for (File file : dir.listFiles()) { deleteFile(file); |
void | cleanDir(File directory) clean Dir if (directory == null) return; final File[] files = directory.listFiles(); if (files == null) return; for (File file : files) { if (file.isDirectory()) { cleanDir(file); ... |
boolean | cleanDir(final File dir) clean Dir boolean success = true; if (dir.exists()) { success = recursiveDelete(dir) && success; return dir.mkdirs() && success; |
void | cleanDir(final File dir) Cleans out the passed directory if (dir == null) throw new IllegalArgumentException("The passed file was null"); if (dir.isFile()) throw new IllegalArgumentException("The passed file [" + dir + "] was not a directory"); for (final File f : dir.listFiles()) { recursiveDel(f); |
void | cleanDir(final File dir, final String exclude) clean Dir final String[] children = dir.list(); for (final String child : children) { if (child.equals(exclude)) { continue; final File file = new File(dir, child); if (file.isDirectory()) { delDir(file); ... |
void | cleanDir(final String luceneDir) clean Dir if (luceneDir != null && luceneDir.length() > 0) { File directory = new File(luceneDir); File[] files = directory.listFiles(); if (files != null) { for (File file : files) { if (file.isDirectory() && !(file.list().length == 0)) { cleanDir(file.getPath()); file.delete(); ... |
boolean | cleanDir(String dir) clean Dir return deleteDir(new File(dir), false); |
boolean | cleanDir(String directory) Empty a directory without deleting it String[] files = ls(directory); boolean clean = true; if (files != null) { for (String f : files) { String filename = directory + File.separator + f; File file = new File(filename); if (file.isDirectory()) clean = cleanDir(filename) && file.delete(); ... |
void | cleanDir(String path) clean Dir File dir = new File(path); if (dir.exists()) { if (!dir.isDirectory()) { throw new IOException("Path is not a directory: " + path); for (File file : dir.listFiles()) { file.delete(); |