code: public static void compress(int format, Resource[] sources, Resource target, int mode) throws IOException {
  
  	if (format == FORMAT_ZIP) compressZip(sources, target, null);
  	else if (format == FORMAT_TAR) compressTar(sources, target, mode);
  	else if (format == FORMAT_TGZ) compressTGZ(sources, target, mode);
  	else if (format == FORMAT_TBZ2) compressTBZ2(sources, target, mode);
  
  	else throw new IOException("can't compress in given format");
      }
docs: compress data to a zip file
  
  @param format format it that should by compressed usually is CompressUtil.FORMAT_XYZ
  @param sources
  @param target
  @param mode
  @throws IOException