List of utility methods to do File Delete
void | clearFile(File file) clear File file.delete(); file.createNewFile(); |
void | clearFile(String directory) clear File try { FileWriter outFile = new FileWriter(directory); PrintWriter out = new PrintWriter(outFile); out.print(""); out.close(); } catch (IOException e) { e.printStackTrace(); |
void | clearFile(String pFileName) clear File try { new FileOutputStream(pFileName); } catch (FileNotFoundException e) { e.printStackTrace(); |
void | clearFileOrDir(File file) Clear directory if (!file.exists()) { return; if (file.isFile()) { file.delete(); return; File[] children = file.listFiles(); ... |
boolean | delete(File aFile) deletes a file from the file system; for directories, recurse the subdirectories and delete them as well if (aFile == null) return true; if (aFile.isDirectory()) { File[] files = aFile.listFiles(); if (files != null) { for (int i = 0; i < files.length; i++) { if (!delete(files[i])) return false; ... |
void | delete(File classDir) delete File[] files = classDir.listFiles(); if (files != null) { for (File f : files) { delete(f); classDir.delete(); |
boolean | delete(File current) delete boolean status = true; if (current.isDirectory()) for (File sub : current.listFiles()) status &= delete(sub); if (current.exists() && (!current.delete())) return false; return status; |
void | delete(File dir) delete if (dir.exists() && dir.isDirectory()) { for (File file : dir.listFiles()) { if (file.isDirectory()) { delete(file); file.delete(); |
void | delete(File dir) delete if (!dir.isDirectory()) { dir.delete(); return; String[] entries = dir.list(); for (String s : entries) { File currentFile = new File(dir.getPath(), s); if (currentFile.isDirectory()) { ... |
boolean | delete(File dir) Delete file or directory. return deleteContents(dir) && dir.delete();
|