List of utility methods to do File Path Delete
boolean | delete(File path) delete if (null == path || !path.exists()) { return false; boolean delete = false; if (path.isDirectory()) { File[] files = path.listFiles(); if (null != files && files.length > 0) { for (File file : files) { ... |
boolean | delete(File path) delete if (!path.exists()) return false; boolean ret = true; if (path.isDirectory()) { for (File f : path.listFiles()) { ret = ret && delete(f); return ret && path.delete(); |
void | delete(File path) deletes files and directories if (path.exists()) { if (path.isDirectory()) { File files[] = path.listFiles(); for (File file : files) { delete(file); path.delete(); } else { ... |
void | delete(File path, String... exclude) delete List<String> excludedPaths = Arrays.asList(exclude); File[] files = path.listFiles(); if (files != null) { for (File file : files) { if (!excludedPaths.contains(file.getName())) { if (file.isDirectory()) { delete(file); file.delete(); |
void | delete(final File path) delete final String[] files = path.list(); String parentPath = path.getPath(); for (final String name : files) { final File file = new File(parentPath, name); if (file.isDirectory()) { delete(file); file.delete(); ... |
boolean | delete(String fileNameWithFullPath) Deletes a File from an url. File file = new File(fileNameWithFullPath); return file.delete(); |
boolean | delete(String filePath) delete File file = new File(filePath); return delete(file); |
void | delete(String filePath) delete boolean result = new File(filePath).delete(); if (!result) { throw new IOException("Delete " + filePath + " failed!"); |
boolean | delete(String filePath) delete File file = new File(filePath); return file.delete(); |
boolean | delete(String filePath) delete return delete(new File(filePath)); |