List of utility methods to do File Delete
void | deleteFile(File file) delete File if (file.exists()) { if (file.isFile()) { file.delete(); } else { File[] files = file.listFiles(); if (files != null) { for (File f : files) { deleteFile(f); ... |
void | deleteFile(String filePath) delete File if (filePath != null) { File file = new File(filePath); deleteFile(file); |
void | delete(File file) delete if (file.exists()) { if (file.isFile()) { file.delete(); } else { File[] files = file.listFiles(); for (File f : files) { delete(f); file.delete(); |
boolean | deleteFile(String fileName) delete File try { File directory = new File(fileName); return directory.delete(); } catch (Throwable e) { return false; |
boolean | DeleteFile(File file) Delete File if (file.isFile()) { return file.delete(); if (file.isDirectory()) { File[] childFile = file.listFiles(); if (childFile == null || childFile.length == 0) { return file.delete(); for (File f : childFile) { DeleteFile(f); return file.delete(); return false; |