code: public void writeArchive(OutputStream output)
              throws IOException, RepositoryException {
  
          ZipOutputStream zipStream = new ZipOutputStream(output);
          writeZip(zipStream, resource.getPath(), true);
          zipStream.flush();
          zipStream.close();
      }
docs: ZIP output