code: public void exportArtifacts(SessionProvider sp, FolderDescriptor parentFolder, OutputStream out)
              throws RepositoryException, FileNotFoundException
     {
  
        Session session = currentSession(sp);
        Node parentNode;
        if (rootNodePath.length() > 1)
        {
           parentNode = (Node) session.getItem(rootNodePath + "/" + parentFolder.getAsPath());
        }
        else
        {
           parentNode = (Node) session.getItem("/" + parentFolder.getAsPath());
        }
  
        LOG.info("Write repository to zipped stream");
  
        ZipOutputStream zout = new ZipOutputStream(new BufferedOutputStream(out, BUFFER));
        try
        {
           mapRepositoryToZipStream(parentNode, zout);
           zout.flush();
           zout.close();
        }
        catch (IOException e)
        {
           LOG.error("Cannot write to zip stream", e);
        }
  
     }
docs: /*
  (non-Javadoc)
  @see org.exoplatform.services.jcr.ext.maven.ArtifactManagingService#exportArtifacts
  (org.exoplatform.services.jcr.ext.common.SessionProvider,
  org.exoplatform.services.jcr.ext.maven.FolderDescriptor, java.io.OutputStream)