/** * GZip compress the contents of inFile into outFile * * @param inFile The source of data * @param outFile The destination for compressed data * * @return A FileCopyResult of the resulting file at outFile * * @throws IOException */ public static FileUtils.FileCopyResult gzip(final File inFile, final File outFile) throws IOException { return gzip(inFile, outFile, FileUtils.IS_EXCEPTION); }
/** * Gzips the input file to the output * * @param inFile The file to gzip * @param outFile A target file to copy the uncompressed contents of inFile to * @param shouldRetry Predicate on a potential throwable to determine if the copy should be attempted again. * * @return The result of the file copy * * @throws IOException */ public static FileUtils.FileCopyResult gzip(final File inFile, final File outFile, Predicate<Throwable> shouldRetry) throws IOException { gzip(Files.asByteSource(inFile), Files.asByteSink(outFile), shouldRetry); return new FileUtils.FileCopyResult(outFile); }