public static void compress ( File dir , File zipFile ) throws IOException { FileOutputStream fos = new FileOutputStream ( zipFile ) ; ZipOutputStream zos = new ZipOutputStream ( fos ) ; recursiveAddZip ( dir , zos , dir ) ; zos . finish ( ) ; zos . close ( ) ; }
Compress a directory into a zip file