code: public static void compressTGZ(Resource[] sources, Resource target, int mode) throws IOException {
  	File tmpTarget = File.createTempFile("_temp", "tmp");
  	try {
  	    // write Tar
  	    OutputStream tmpOs = new FileOutputStream(tmpTarget);
  	    try {
  		compressTar(sources, tmpOs, mode);
  	    }
  	    finally {
  		IOUtil.closeEL(tmpOs);
  	    }
  
  	    // write Gzip
  	    InputStream is = null;
  	    OutputStream os = null;
  	    try {
  		is = new FileInputStream(tmpTarget);
  		os = target.getOutputStream();
  		compressGZip(is, os);
  	    }
  	    finally {
  		IOUtil.closeEL(is, os);
  	    }
  	}
  	finally {
  	    tmpTarget.delete();
  	}
      }
docs: compress a source file/directory to a tar/gzip file
  
  @param sources
  @param target
  @param mode
  @throws IOException