Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.ReceivePack.receive()


    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


    if (key != null && !key.canPush()) {
      throw new Failure(1, "Sorry, your SSH public key is not allowed to push changes!");
    }
    try {
      ReceivePack rp = receivePackFactory.create(getContext().getClient(), repo);
      rp.receive(in, out, null);
    } catch (Exception e) {
      throw new Failure(1, "fatal: Cannot receive pack: ", e);
    }
  }
}
View Full Code Here

              throws IOException, ServiceNotEnabledException,
              ServiceNotAuthorizedException {
            ReceivePack rp = receivePackFactory.create(dc, db);
            InputStream in = dc.getInputStream();
            OutputStream out = dc.getOutputStream();
            rp.receive(in, out, null);
          }
        } };
  }

  public int getPort() {
View Full Code Here

    rp.setRefLogIdent(currentUser.newRefLogIdent());
    rp.setTimeout(config.getTimeout());
    rp.setMaxObjectSizeLimit(config.getMaxObjectSizeLimit());
    try {
      receive.advertiseHistory();
      rp.receive(in, out, err);
    } catch (UnpackException badStream) {
      // In case this was caused by the user pushing an object whose size
      // is larger than the receive.maxObjectSizeLimit gerrit.config parameter
      // we want to present this error to the user
      if (badStream.getCause() instanceof TooLargeObjectInPackException) {
View Full Code Here

      final ReceivePack rp = receivePackFactory.create(req, db);
      rp.setBiDirectionalPipe(false);
      rsp.setContentType(RSP_TYPE);

      final SmartOutputStream out = new SmartOutputStream(req, rsp);
      rp.receive(getInputStream(req), out, null);
      out.close();

    } catch (ServiceNotAuthorizedException e) {
      rsp.sendError(SC_UNAUTHORIZED);
      return;
View Full Code Here

        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

    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 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

    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

TOP
Copyright © 2018 www.massapi.com. 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.