code: @SuppressWarnings({ "rawtypes", "unchecked" })
      public static void zipFile(String folderToZip, String zipFile, String[] filesToInclude)
          throws FileNotFoundException, IOException {
          Logger logger = Logger.getLogger(Utils.class);
          logger.debug("zipFile: "+folderToZip);
  
          ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipFile));    
          boolean excludeContainingFolder = false;
  
          File srcFile = new File(folderToZip);
          if(excludeContainingFolder && srcFile.isDirectory()) {
              for(String fileName : srcFile.list()) {
                  addToZip("", folderToZip + "/" + fileName, zipOut, filesToInclude);
              }
          } else {
              addToZip("", folderToZip, zipOut, filesToInclude);
          }
  
          zipOut.flush();
          zipOut.close();
          logger.debug("Successfully created zipFile: " + zipFile);
      }
docs: Zip up all files (or those that match filesToInclude[]) under a directory into a zipfile with the given name.
  @param folderToZip {String} folder containing files to zip
  @param zipFile {String} zipfile name for destination
  @param filesToInclude {String[]} files to include - if omitted everything under folder will be zipped
  @throws FileNotFoundException folder to zip up not found
  @throws IOException problem in creating zipfile