private static void compressGZip ( Resource source , Resource target ) throws IOException { if ( source . isDirectory ( ) ) { throw new IOException ( "you can only create a GZIP File from a single source file, use TGZ (TAR-GZIP) to first TAR multiple files" ) ; } InputStream is = null ; OutputStream os = null ; try { is = source . getInputStream ( ) ; os = target . getOutputStream ( ) ; } catch ( IOException ioe ) { IOUtil . closeEL ( is , os ) ; throw ioe ; } compressGZip ( is , os ) ; }
compress a source file to a gzip file