/** * Delete the specified File. * * @param file the file to delete */ public static void deleteFile(File file) { inputNotNull(file); if (!file.exists() || !file.canRead() || !file.isFile()) throw new IllegalStateException("Source is not in a legal state."); if (file.delete()) return; IOUtils.FILE_CLEANER.addFile(file); }
/** * Delete the specified File. * * @param sourceDirectory the directory to delete files from. * @param filter the {@link FilenameFilter} to use for selecting files to delete. * @param recursive boolean that specifies if we want to delete files recursively or not. * @return */ public static void deleteFile(File file) { inputNotNull(file); if(!file.exists()||!file.canRead()||!file.isFile()) throw new IllegalStateException("Source is not in a legal state."); if(file.delete()) return; IOUtils.FILE_CLEANER.addFile(file); }
if (removeInputFile) FILE_CLEANER.addFile(source);
FILE_CLEANER.addFile(source);