@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()); } }); }
for (Filter f : uploadPackFilters) b = b.through(f); b.with(new UploadPackServlet()); for (Filter f : receivePackFilters) b = b.through(f); b.with(new ReceivePackServlet()); refs = refs.through(new IsLocalFilter()); refs = refs.through(new AsIsFileFilter(asIs)); refs.with(new InfoRefsServlet()); } else refs.with(new ErrorServlet(HttpServletResponse.SC_NOT_ACCEPTABLE)); .with(new TextFileServlet(Constants.HEAD)); .with(new TextFileServlet(info_alternates)); .with(new TextFileServlet(http_alternates)); .with(new InfoPacksServlet()); .with(new ObjectFileServlet.Loose()); .with(new ObjectFileServlet.Pack()); .with(new ObjectFileServlet.PackIdx());
for (Filter f : uploadPackFilters) b = b.through(f); b.with(new UploadPackServlet()); for (Filter f : receivePackFilters) b = b.through(f); b.with(new ReceivePackServlet()); refs = refs.through(new IsLocalFilter()); refs = refs.through(new AsIsFileFilter(asIs)); refs.with(new InfoRefsServlet()); } else refs.with(new ErrorServlet(HttpServletResponse.SC_NOT_ACCEPTABLE)); .with(new TextFileServlet(Constants.HEAD)); .with(new TextFileServlet(info_alternates)); .with(new TextFileServlet(http_alternates)); .with(new InfoPacksServlet()); .with(new ObjectFileServlet.Loose()); .with(new ObjectFileServlet.Pack()); .with(new ObjectFileServlet.PackIdx());