code: public static void extract(int format, Resource source, Resource target) throws IOException {
  	if (format == FORMAT_ZIP) extractZip(source, target);
  	else if (format == FORMAT_TAR) extractTar(source, target);
  	else if (format == FORMAT_GZIP) extractGZip(source, target);
  	else if (format == FORMAT_TGZ) extractTGZ(source, target);
  	else throw new IOException("can't extract in given format");
      }
docs: extract a zip file to a directory
  
  @param format
  @param source
  @param target
  @throws IOException