@Override public void init(ServletConfig config) throws ServletException { super.init(config); try { counter = new SharedCount(curator, ZkPath.GIT_TRIGGER.getPath(), 0); counter.start(); } catch (Exception ex) { LOGGER.error("Error starting SharedCount", ex); throw new ServletException("Error starting SharedCount", ex); } }
@Override public void init(final ServletConfig config) throws ServletException { gitFacade = GitFacade.getSingleton(); validateGitFacade(); String basePath = gitFacade.getRootGitDirectory().getAbsoluteFile().getParentFile().getAbsolutePath(); System.out.println("Exposing git base path at: " + basePath); final Hashtable<String,String> initParams = new Hashtable<>(); initParams.put("base-path", basePath); initParams.put("repository-root", basePath); initParams.put("export-all", "true"); ServletConfig gitConfig = new ServletConfig() { @Override public String getServletName() { return config.getServletName(); } @Override public ServletContext getServletContext() { return config.getServletContext(); } @Override public String getInitParameter(String paramName) { return initParams.get(paramName); } @Override public Enumeration<String> getInitParameterNames() { return initParams.keys(); } }; super.init(gitConfig); }
@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()); } }); }
@Override public void init(ServletConfig config) throws ServletException { addUploadPackFilter(new UploadPackFilter()); setReceivePackFactory(receive); setRepositoryResolver(speakeasyRepositoryResolver); super.init(config); }
@Override public void init(ServletConfig config) throws ServletException { super.init(config); try { counter = new SharedCount(curator, ZkPath.GIT_TRIGGER.getPath(), 0); counter.start(); } catch (Exception ex) { handleException(ex); } }