List of utility methods to do File Delete
void | delete(File file) Delete a file. if (file == null || !file.exists()) return; if (!file.delete()) throw new IOException("Unable to delete file " + file.getAbsolutePath()); |
boolean | delete(File file) delete if (file == null || !file.exists()) { return false; boolean result = true; if (file.isDirectory()) { String[] children = file.list(); for (int i = 0; i < children.length; i++) { result &= delete(new File(file, children[i])); ... |
void | delete(File file) delete if (file.isDirectory() && file.list().length > 0) { String files[] = file.list(); for (String tmpFile : files) { File fileToDelete = new File(file, tmpFile); delete(fileToDelete); file.delete(); ... |
void | delete(File file) same as file.delete() if 'file' is file; recursively deletes all elements inside if 'file' is directory. if (file.isFile()) { file.delete(); } else { for (File f : file.listFiles()) { delete(f); file.delete(); |
void | delete(File file) Deletes the specified file, throwing a RuntimeException if the delete fails. if (!file.delete()) { throw new RuntimeException("File " + file.getAbsolutePath() + " can't be deleted."); |
boolean | delete(File file) Delete a File. boolean result = true; if (file == null) { return false; if (file.exists()) { if (file.isDirectory()) { File[] children = file.listFiles(); for (File child : children) { ... |
void | delete(File file) delete if (file.isDirectory()) { File[] children = file.listFiles(); for (int i = 0; i < children.length; i++) { delete(children[i]); if (!file.delete()) { throw new IOException("Unable to delete " + file.getPath()); ... |
boolean | delete(File file) Deletes recursively the given file (if it is a directory) or just removes itself if (file.isDirectory()) { File[] contents = file.listFiles(); if (null != contents) { for (File child : contents) { delete(child); file.delete(); ... |
void | delete(File file) delete if (file.isDirectory()) { if (file.list().length == 0) { file.delete(); System.out.println("Directory is deleted : " + file.getAbsolutePath()); } else { String files[] = file.list(); for (String temp : files) { File fileDelete = new File(file, temp); ... |
boolean | delete(File file) Delete a file or directory and insure that the file is no longer present on file system. if (file.isDirectory()) { flushDirectoryContent(file); file.delete(); if (isFileDeleted(file)) { return true; return waitUntilFileDeleted(file); ... |