@Override public void run() { try { final UploadPack rp = uploadPackFactory.create(req, remote); rp.upload(out_r, in_w, null); } catch (ServiceNotEnabledException e) { // Ignored. Client cannot use this repository. } catch (ServiceNotAuthorizedException e) { // Ignored. Client cannot use this repository. } catch (IOException err) { // Client side of the pipes should report the problem. err.printStackTrace(); } catch (RuntimeException err) { // Client side will notice we went away, and report. err.printStackTrace(); } finally { try { out_r.close(); } catch (IOException e2) { // Ignore close failure, we probably crashed above. } try { in_w.close(); } catch (IOException e2) { // Ignore close failure, we probably crashed above. } remote.close(); } } };
@Override protected void execute(final DaemonClient dc, final Repository db, @Nullable Collection<String> extraParameters) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { UploadPack up = uploadPackFactory.create(dc, db); InputStream in = dc.getInputStream(); OutputStream out = dc.getOutputStream(); if (extraParameters != null) { up.setExtraParameters(extraParameters); } up.upload(in, out, null); } }, new DaemonService("receive-pack", "receivepack") { //$NON-NLS-1$ //$NON-NLS-2$
@Override protected void begin(HttpServletRequest req, Repository db) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { UploadPack up = uploadPackFactory.create(req, db); req.setAttribute(ATTRIBUTE_HANDLER, up); }
@Override protected void begin(HttpServletRequest req, Repository db) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { UploadPack up = uploadPackFactory.create(req, db); InternalHttpServerGlue.setPeerUserAgent( up, req.getHeader(HDR_USER_AGENT)); req.setAttribute(ATTRIBUTE_HANDLER, up); }
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse rsp = (HttpServletResponse) response; UploadPack rp; try { rp = uploadPackFactory.create(req, getRepository(req)); } catch (ServiceNotAuthorizedException e) { rsp.sendError(SC_UNAUTHORIZED); return; } catch (ServiceNotEnabledException e) { sendError(req, rsp, SC_FORBIDDEN); return; } try { req.setAttribute(ATTRIBUTE_HANDLER, rp); chain.doFilter(req, rsp); } finally { req.removeAttribute(ATTRIBUTE_HANDLER); } }
@Override public void run() { try { final UploadPack rp = uploadPackFactory.create(req, remote); rp.upload(out_r, in_w, null); } catch (ServiceNotEnabledException e) { // Ignored. Client cannot use this repository. } catch (ServiceNotAuthorizedException e) { // Ignored. Client cannot use this repository. } catch (IOException err) { // Client side of the pipes should report the problem. err.printStackTrace(); } catch (RuntimeException err) { // Client side will notice we went away, and report. err.printStackTrace(); } finally { try { out_r.close(); } catch (IOException e2) { // Ignore close failure, we probably crashed above. } try { in_w.close(); } catch (IOException e2) { // Ignore close failure, we probably crashed above. } remote.close(); } } };
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse rsp = (HttpServletResponse) response; UploadPack rp; try { rp = uploadPackFactory.create(req, getRepository(req)); } catch (ServiceNotAuthorizedException e) { rsp.sendError(SC_UNAUTHORIZED, e.getMessage()); return; } catch (ServiceNotEnabledException e) { sendError(req, rsp, SC_FORBIDDEN, e.getMessage()); return; } try { req.setAttribute(ATTRIBUTE_HANDLER, rp); chain.doFilter(req, rsp); } finally { req.removeAttribute(ATTRIBUTE_HANDLER); } }
@Override protected void execute(final DaemonClient dc, final Repository db) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { final UploadPack up = uploadPackFactory.create(dc, db); final InputStream in = dc.getInputStream(); final OutputStream out = dc.getOutputStream(); up.upload(in, out, null); } }, new DaemonService("receive-pack",
@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); } }, new DaemonService("receive-pack", "receivepack") { //$NON-NLS-1$ //$NON-NLS-2$
@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 ); } }, new DaemonService( "receive-pack", "receivepack" ) {
public void run() { try { final UploadPack rp = uploadPackFactory.create(req, remote); rp.upload(out_r, in_w, null); } catch (ServiceNotEnabledException e) { // Ignored. Client cannot use this repository. } catch (ServiceNotAuthorizedException e) { // Ignored. Client cannot use this repository. } catch (IOException err) { // Client side of the pipes should report the problem. err.printStackTrace(); } catch (RuntimeException err) { // Client side will notice we went away, and report. err.printStackTrace(); } finally { try { out_r.close(); } catch (IOException e2) { // Ignore close failure, we probably crashed above. } try { in_w.close(); } catch (IOException e2) { // Ignore close failure, we probably crashed above. } remote.close(); } } };
@Override protected void execute(final DaemonClient dc, final Repository db, @Nullable Collection<String> extraParameters) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { UploadPack up = uploadPackFactory.create(dc, db); InputStream in = dc.getInputStream(); OutputStream out = dc.getOutputStream(); if (extraParameters != null) { up.setExtraParameters(extraParameters); } up.upload(in, out, null); } }, new DaemonService("receive-pack", "receivepack") { //$NON-NLS-1$ //$NON-NLS-2$