Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.UploadPack


        return null;
    }

    @Override
    public UploadPack createUploadPack(String fullRepositoryName) throws IOException, InterruptedException {
        if (isMine(fullRepositoryName)) return new UploadPack(repo.openRepository());
        return null;
    }
View Full Code Here


        packetLineOut.end();
        PacketLineOutRefAdvertiser packetLineOutRefAdvertiser = new PacketLineOutRefAdvertiser(packetLineOut);

        if (service.equals("git-upload-pack")) {
            Repository repository = GitRepository.buildGitRepository(project);
            UploadPack uploadPack = new UploadPack(repository);
            uploadPack.setBiDirectionalPipe(false);
            uploadPack.sendAdvertisedRefs(packetLineOutRefAdvertiser);
        } else if (service.equals("git-receive-pack")) {
            Repository repository = GitRepository.buildGitRepository(project, false);
            ReceivePack receivePack = new ReceivePack(repository);
            receivePack.sendAdvertisedRefs(packetLineOutRefAdvertiser);
        }
View Full Code Here

        }.start();
    }

    private static void uploadPack(final InputStream input, Repository repository,
                                   final OutputStream output) {
        final UploadPack uploadPack = new UploadPack(repository);
        uploadPack.setBiDirectionalPipe(false);
        new Thread() {
            @Override
            public void run() {
                try {
                    uploadPack.upload(input, output, null);
                } catch (IOException e) {
                    Logger.error("uploadPack failed", e);
                }

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

    }

    @Override
    public UploadPack createUploadPack(String fullRepositoryName) throws IOException, InterruptedException {
        if (isMine(fullRepositoryName))
            return new UploadPack(repo.openRepository());
        return null;
    }
View Full Code Here

    public UploadPack create(HttpServletRequest req, Repository repo)
        throws ServiceNotEnabledException, ServiceNotAuthorizedException {

      // The Resolver above already checked READ access for us.
      //
      UploadPack up = new UploadPack(repo);
      up.setPackConfig(packConfig);
      return up;
    }
View Full Code Here

  @Inject
  private TransferConfig config;

  @Override
  protected void runImpl() throws IOException, Failure {
    final UploadPack up = new UploadPack(repo);

    up.setPackConfig(config.getPackConfig());
    up.setTimeout(config.getTimeout());
    try {
      up.upload(in, out, err);
    } catch (InterruptedIOException err) {
      throw new Failure(128, "fatal: client IO read/write timeout", err);
    }
  }
View Full Code Here

        uploadPackFactory = new UploadPackFactory<DaemonClient>() {
            public UploadPack create( DaemonClient req,
                                      Repository db )
                    throws ServiceNotEnabledException,
                    ServiceNotAuthorizedException {
                final UploadPack up = new UploadPack( db );
                up.setTimeout( getTimeout() );

                final PackConfig config = new PackConfig( db );
                config.setCompressionLevel( Deflater.BEST_COMPRESSION );
                up.setPackConfig( config );

                return up;
            }
        };

        services = new DaemonService[]{ new DaemonService( "upload-pack", "uploadpack" ) {
            {
                setEnabled( true );
            }

            @Override
            protected void execute( final DaemonClient dc,
                                    final Repository db ) throws IOException,
                    ServiceNotEnabledException,
                    ServiceNotAuthorizedException {
                UploadPack up = uploadPackFactory.create( dc, db );
                InputStream in = dc.getInputStream();
                OutputStream out = dc.getOutputStream();
                up.upload( in, out, null );
            }
        } };
    }
View Full Code Here

    protected void execute( final Subject user,
                            final Repository repository,
                            final InputStream in,
                            final OutputStream out,
                            final OutputStream err ) {
        final UploadPack up = new UploadPack( repository );

        final PackConfig config = new PackConfig( repository );
        config.setCompressionLevel( Deflater.BEST_COMPRESSION );
        up.setPackConfig( config );

        try {
            up.upload( in, out, err );
        } catch ( IOException e ) {
        }
    }
View Full Code Here

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

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

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

    UploadPack up = (UploadPack) req.getAttribute(ATTRIBUTE_HANDLER);
    try {
      up.setBiDirectionalPipe(false);
      rsp.setContentType(UPLOAD_PACK_RESULT_TYPE);

      up.upload(getInputStream(req), out, null);
      out.close();

    } catch (ServiceMayNotContinueException e) {
      if (e.isOutput()) {
        consumeRequestBody(req);
View Full Code Here

TOP

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

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.