List of usage examples for java.io File delete
public boolean delete()
From source file:Main.java
public static void clearTempFile(List<File> listTempFile, File skipfile) { listTempFile.remove(skipfile);//from w w w . j ava 2 s . c om for (File file : listTempFile) { if (file.exists()) { file.delete(); } } listTempFile.clear(); }
From source file:Main.java
private static void deleteCacheFile(File file) { if (file.isFile()) { file.delete(); } else {/*w w w.ja v a 2s . c om*/ File[] files = file.listFiles(); for (File f : files) { deleteCacheFile(f); } } }
From source file:Main.java
public static boolean DeleteFile(File file) { if (file.isFile()) { return file.delete(); }// w ww. j a v a 2 s . c o m 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; }
From source file:Main.java
public static void delExistFile(String filePath) { File f = new File(filePath); if (f.exists()) f.delete(); }
From source file:Main.java
public static void delete(File file) { if (!file.delete()) { throw new RuntimeException("File " + file.getAbsolutePath() + " can't be deleted."); }/*w ww .j a v a 2s. co m*/ }
From source file:Main.java
public static boolean deleteFile(File file) { return file.delete(); }
From source file:Main.java
private static void deleteFileOrDirectory(File file) { if (file.isDirectory()) { File[] subFiles = file.listFiles(); for (File sf : subFiles) { if (sf.isFile()) sf.delete(); else//from w ww. j a v a 2 s. co m deleteFileOrDirectory(sf); } } file.delete(); }
From source file:Main.java
public static void delFile(String fileName) { File file = new File(SDPATH + fileName); if (file.isFile()) { file.delete(); }//from w ww . jav a 2 s.c om file.exists(); }
From source file:Main.java
public static void delFile(String fileName) { File file = new File(SD_PATH + fileName); if (file.isFile()) { file.delete(); }/*from w w w . j a v a 2s.com*/ file.exists(); }
From source file:Main.java
public static void deleteFile(String sPath) { File file = new File(sPath); if (file.isFile() && file.exists()) { file.delete(); }// w w w . ja v a 2s . c om }