List of utility methods to do File Path Delete
void | deleteDirectory(File path, boolean deleteMyself, boolean deleteHidden) delete Directory if (path.exists()) { File[] files = path.listFiles(); for (int i = 0; i < files.length; i++) { if (deleteHidden || !files[i].getName().startsWith(".")) { if (files[i].isDirectory()) { deleteDirectory(files[i], true, deleteHidden); } else { files[i].delete(); ... |
boolean | deleteDirectory(File path, boolean includeDir) delete Directory boolean success = true; if (path.exists()) { File[] files = path.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { success = deleteDirectory(files[i], true) && success; } else { success = files[i].delete() && success; ... |
boolean | deleteDirectory(final File path) Uses an iterative algorithm to recursively delete an entire directory and all its subdirectories. if (!path.isDirectory()) throw new IllegalArgumentException("path must be a directory"); if (path == null) return false; if (!path.exists()) return true; try { File curr; ... |
boolean | deleteDirectory(final File path) delete Directory if (path.exists()) { final File[] files = path.listFiles(); if (files != null) { for (final File file : files) { if (file.isDirectory()) { deleteDirectory(file); } else { file.delete(); ... |
boolean | deleteDirectory(final String directoryPath) delete Directory return deleteDirectory(new File(directoryPath)); |
boolean | deleteDirectory(final String fullDirPath) delete Directory String sp = System.getProperty("file.separator"); File texDir = new File(fullDirPath); if (texDir.exists() && texDir.isDirectory()) { String[] dirList = texDir.list(); for (String aDirList : dirList) { String myDirPath = texDir.getAbsolutePath() + sp + aDirList; File d = new File(myDirPath); if (d.exists() && d.isDirectory()) { ... |
void | deleteDirectory(final String path) Deletes a file or directory File file = new File(path);
deleteDirectory(file);
|
boolean | deleteDirectory(String dir_path) Utilitary method to delete the directory corresponding to the given path return deleteDirectory(new File(dir_path)); |
boolean | DeleteDirectory(String directoryPath) Remove a directory and all of its contents. if (directoryPath == null || directoryPath.isEmpty()) { return false; File directory = new File(directoryPath); if (directory == null) return false; if (!directory.exists()) return true; ... |
boolean | deleteDirectory(String directoryPath) delete Directory File directory = new File(directoryPath); if (directory.isDirectory()) { if (directory.listFiles().length == 0) { return delete(directory, true); return false; |