public static void zipDir(String zipDirectory,String outputFile){
  ZipOutputStream zip=null;
  FileOutputStream fileWriter=null;
  try {
    fileWriter=new FileOutputStream(outputFile);
    zip=new ZipOutputStream(fileWriter);
    addFolderToZip("",zipDirectory,zip);
    zip.close();
    fileWriter.close();
  }
 catch (  IOException e) {
    LOGGER.log(Level.WARNING,"Unable to zip file",e);
  }
}

public static void zipDir ( String zipDirectory , String outputFile ) { ZipOutputStream zip = null ; FileOutputStream fileWriter = null ; try { fileWriter = new FileOutputStream ( outputFile ) ; zip = new ZipOutputStream ( fileWriter ) ; addFolderToZip ( "" , zipDirectory , zip ) ; zip . close ( ) ; fileWriter . close ( ) ; } catch ( IOException e ) { LOGGER . log ( Level . WARNING , "Unable to zip file" , e ) ; } }
zip a directory , output to a . zip file
