Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.ReceivePack


    }

    private static void receivePack(final InputStream input, Repository repository,
                                    final OutputStream output,
                                    final PostReceiveHook postReceiveHook) {
        final ReceivePack receivePack = new ReceivePack(repository);
        receivePack.setBiDirectionalPipe(false);
        new Thread() {
            @Override
            public void run() {
                try {
                    receivePack.setPostReceiveHook(postReceiveHook);
                    receivePack.receive(input, output, null);
                } catch (IOException e) {
                    Logger.error("receivePack failed", e);
                }

                closeStreams("receivePack", input, output);
View Full Code Here


  @Override
  protected void runImpl() throws IOException, Failure {


    final ReceivePack rp = new ReceivePack(repo);
    rp.setRefLogIdent(currentUser.newRefLogIdent());
    rp.setTimeout(config.getTimeout());
    try {
      rp.receive(in, out, err);
    } catch (InterruptedIOException err) {
      throw new Failure(128, "fatal: client IO read/write timeout", err);

    } catch (UnpackException badStream) {
      // This may have been triggered by branch level access controls.
View Full Code Here

                            final Repository repository,
                            final InputStream in,
                            final OutputStream out,
                            final OutputStream err ) {
        try {
            final ReceivePack rp = receivePackFactory.create( this, repository );
            rp.receive( in, out, err );
        } catch ( Exception ex ) {
        }
    }
View Full Code Here

        final ReceivePackFactory receivePackFactory = new ReceivePackFactory<BaseGitCommand>() {
            @Override
            public ReceivePack create( final BaseGitCommand req,
                                       final Repository db ) throws ServiceNotEnabledException, ServiceNotAuthorizedException {

                return new ReceivePack( db ) {{
                    final ClusterService clusterService = clusterMap.get( db );
                    final JGitFileSystem fs = repoIndex.get( db );
                    final Map<String, RevCommit> oldTreeRefs = new HashMap<String, RevCommit>();

                    setPreReceiveHook( new PreReceiveHook() {
View Full Code Here

      HttpServletResponse res, String textForGit) throws IOException {
    ByteArrayOutputStream buf = new ByteArrayOutputStream(128);
    PacketLineOut pckOut = new PacketLineOut(buf);

    boolean sideband;
    ReceivePack rp = (ReceivePack) req.getAttribute(ATTRIBUTE_HANDLER);
    if (rp != null) {
      try {
        sideband = rp.isSideBand();
      } catch (RequestNotYetReadException e) {
        sideband = isReceivePackSideBand(req);
      }
    } else
      sideband = isReceivePackSideBand(req);
View Full Code Here

      public void flush() throws IOException {
        doFlush();
      }
    };

    ReceivePack rp = (ReceivePack) req.getAttribute(ATTRIBUTE_HANDLER);
    try {
      rp.setBiDirectionalPipe(false);
      rp.setEchoCommandFailures(hasPushStatusBug(version));
      rsp.setContentType(RECEIVE_PACK_RESULT_TYPE);

      rp.receive(getInputStream(req), out, null);
      out.close();
    } catch (UnpackException e) {
      // This should be already reported to the client.
      getServletContext().log(
          HttpServerText.get().internalErrorDuringReceivePack,
View Full Code Here

    @Override
    protected void begin(HttpServletRequest req, Repository db)
        throws IOException, ServiceNotEnabledException,
        ServiceNotAuthorizedException {
      ReceivePack rp = receivePackFactory.create(req, db);
      req.setAttribute(ATTRIBUTE_HANDLER, rp);
    }
View Full Code Here

    @Override
    protected void advertise(HttpServletRequest req,
        PacketLineOutRefAdvertiser pck) throws IOException,
        ServiceNotEnabledException, ServiceNotAuthorizedException {
      ReceivePack rp = (ReceivePack) req.getAttribute(ATTRIBUTE_HANDLER);
      try {
        rp.sendAdvertisedRefs(pck);
      } finally {
        rp.getRevWalk().release();
      }
    }
View Full Code Here

    public void doFilter(ServletRequest request, ServletResponse response,
        FilterChain chain) throws IOException, ServletException {
      HttpServletRequest req = (HttpServletRequest) request;
      HttpServletResponse rsp = (HttpServletResponse) response;
      ReceivePack rp;
      try {
        rp = receivePackFactory.create(req, getRepository(req));
      } catch (ServiceNotAuthorizedException e) {
        rsp.sendError(SC_UNAUTHORIZED);
        return;
View Full Code Here

    throw new ServiceNotAuthorizedException();
  }

  private static ReceivePack createFor(final HttpServletRequest req,
      final Repository db, final String user) {
    final ReceivePack rp = new ReceivePack(db);
    rp.setRefLogIdent(toPersonIdent(req, user));
    return rp;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.ReceivePack

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.