/** * Deletes all given <tt>Path</tt>s, if they exist. Some of the * <tt>File</tt>s may be null; they are * ignored. After everything is deleted, the method either * throws the first exception it hit while deleting, or * completes normally if there were no exceptions. * * @param files files to delete */ public static void deleteFilesIfExist(Path... files) throws IOException { deleteFilesIfExist(Arrays.asList(files)); }
/** * Deletes all given <tt>Path</tt>s, if they exist. Some of the * <tt>File</tt>s may be null; they are * ignored. After everything is deleted, the method either * throws the first exception it hit while deleting, or * completes normally if there were no exceptions. * * @param files files to delete */ public static void deleteFilesIfExist(Path... files) throws IOException { deleteFilesIfExist(Arrays.asList(files)); }
/** * Deletes all given <tt>Path</tt>s, if they exist. Some of the * <tt>File</tt>s may be null; they are * ignored. After everything is deleted, the method either * throws the first exception it hit while deleting, or * completes normally if there were no exceptions. * * @param files files to delete */ public static void deleteFilesIfExist(Path... files) throws IOException { deleteFilesIfExist(Arrays.asList(files)); }
public void tearDown() throws Exception { IOUtils.deleteFilesIfExist(baseDir.toPath()); }
/** * Deletes all given <tt>Path</tt>s, if they exist. Some of the * <tt>File</tt>s may be null; they are * ignored. After everything is deleted, the method either * throws the first exception it hit while deleting, or * completes normally if there were no exceptions. * * @param files files to delete */ public static void deleteFilesIfExist(Path... files) throws IOException { deleteFilesIfExist(Arrays.asList(files)); }
private void close() throws IOException { boolean success = false; try { IOUtils.close(reader); success = true; } finally { if (success) { IOUtils.deleteFilesIfExist(tempInput, tempSorted); } else { IOUtils.deleteFilesIgnoringExceptions(tempInput, tempSorted); } } }
/** * Removes any written temporary files. */ @Override public void close() throws IOException { boolean success = false; try { closeWriter(); success = true; } finally { if (success) { IOUtils.deleteFilesIfExist(input, sorted); } else { IOUtils.deleteFilesIgnoringExceptions(input, sorted); } } }
} finally { if (success2) { IOUtils.deleteFilesIfExist(merges); } else { IOUtils.deleteFilesIgnoringExceptions(merges); } finally { if (success3) { IOUtils.deleteFilesIfExist(merges); } else { IOUtils.deleteFilesIgnoringExceptions(merges);
} finally { if (success2) { IOUtils.deleteFilesIfExist(merges); } else { IOUtils.deleteFilesIgnoringExceptions(merges); } finally { if (success3) { IOUtils.deleteFilesIfExist(merges); } else { IOUtils.deleteFilesIgnoringExceptions(merges);
IOUtils.deleteFilesIfExist(tempInput, tempSorted); } else { IOUtils.deleteFilesIgnoringExceptions(tempInput, tempSorted);
IOUtils.deleteFilesIfExist(tempInput, tempSorted); } else { IOUtils.deleteFilesIgnoringExceptions(tempInput, tempSorted);