List of utility methods to do File Path Delete
boolean | deleteFile(String path, String filename) delete File File dir = new File(path); if (!dir.exists()) throw new FileNotFoundException("Directory " + path + " doesn't exist."); File serverFile = new File(dir.getAbsolutePath() + File.separator + filename); boolean result = serverFile.delete(); return result; |
void | deleteFile(String strFolderPath, String strFileName) Delete a file File file = new File(strFolderPath + strFileName); if (file.exists()) { if (!file.delete()) { throw new IOException("ERROR when deleting the file or folder " + strFolderPath + strFileName); |
boolean | deleteFile(String strPath) delete File boolean bOk = true; if (strPath == null) return false; File flItem = new File(strPath); if (flItem != null) flItem.delete(); else bOk = false; ... |
boolean | deleteFile(String strPath, String fileName) delete File File file = findIt(strPath, fileName); if (file != null) { return file.delete(); return false; |
void | DeleteFileFolder(String path) Delete File Folder File file = new File(path); if (file.exists()) { do { delete(file); } while (file.exists()); } else { System.out.println("File or Folder not found : " + path); |
void | deleteFileFromDisk(String name, String path) delete File From Disk java.io.File file = new java.io.File(path + name); if (file.isFile() && file.exists()) { file.delete(); |
boolean | deleteFileIfExists(String path) delete File If Exists File f = new File(path); if (f.exists() && !f.isDirectory()) { return f.delete(); return false; |
void | deleteFileOrDirectory(String path) delete File Or Directory deleteFileOrDirectory(new File(path));
|
void | deleteFileOrDirectory(String path) delete File Or Directory synchronized (path.intern()) { File f = new File(path); deleteFileOrDirectory(f); |
void | deleteFiles(final File pathname) Description goes here. if (pathname.isDirectory()) { for (File file : pathname.listFiles()) { if (file.isFile()) { file.delete(); } else if (file.isDirectory() && !".".equals(file.getName()) && !"..".equals(file.getName())) { deleteFiles(file); pathname.delete(); |