b = b.through(new UploadPackServlet.Factory(uploadPackFactory)); for (Filter f : uploadPackFilters) b = b.through(f); b.with(new UploadPackServlet()); b = b.through(new ReceivePackServlet.Factory(receivePackFactory)); for (Filter f : receivePackFilters) b = b.through(f); b.with(new ReceivePackServlet()); refs = refs.through(new UploadPackServlet.InfoRefs( uploadPackFactory, uploadPackFilters)); refs = refs.through(new ReceivePackServlet.InfoRefs( receivePackFactory, receivePackFilters)); refs = refs.through(new IsLocalFilter()); refs = refs.through(new AsIsFileFilter(asIs)); refs.with(new InfoRefsServlet()); } else refs.with(new ErrorServlet(HttpServletResponse.SC_NOT_ACCEPTABLE)); .through(mustBeLocal)// .through(enabled)// .with(new TextFileServlet(Constants.HEAD)); .through(mustBeLocal)// .through(enabled)// .with(new TextFileServlet(info_alternates));
@Override public void init(ServletConfig config) throws ServletException { super.init(config); serveRegex("^/(.*?)/?$").with(new HttpServlet() { @Override protected void doGet(HttpServletRequest req, HttpServletResponse rsp) throws IOException { String pc; try { pc = getProject(req); } catch (ServiceNotEnabledException e) { rsp.sendError(HttpServletResponse.SC_NOT_FOUND); return; } StringBuilder r = new StringBuilder(); r.append(urlProvider.get()); rsp.sendRedirect(r.toString()); } }); }
b = b.through(new UploadPackServlet.Factory(uploadPackFactory)); for (Filter f : uploadPackFilters) b = b.through(f); b.with(new UploadPackServlet()); b = b.through(new ReceivePackServlet.Factory(receivePackFactory)); for (Filter f : receivePackFilters) b = b.through(f); b.with(new ReceivePackServlet()); refs = refs.through(new UploadPackServlet.InfoRefs( uploadPackFactory, uploadPackFilters)); refs = refs.through(new ReceivePackServlet.InfoRefs( receivePackFactory, receivePackFilters)); refs = refs.through(new IsLocalFilter()); refs = refs.through(new AsIsFileFilter(asIs)); refs.with(new InfoRefsServlet()); } else refs.with(new ErrorServlet(HttpServletResponse.SC_NOT_ACCEPTABLE)); .through(mustBeLocal)// .through(enabled)// .with(new TextFileServlet(Constants.HEAD)); .through(mustBeLocal)// .through(enabled)// .with(new TextFileServlet(info_alternates));