use of org.eclipse.jgit.http.server.glue.ServletBinder in project gitiles by GerritCodeReview.
the class GitilesFilter method init.
@Override
public synchronized void init(FilterConfig config) throws ServletException {
super.init(config);
setDefaultFields(config);
for (GitilesView.Type type : GitilesView.Type.values()) {
if (!servlets.containsKey(type)) {
servlets.put(type, getDefaultHandler(type));
}
}
Filter repositoryFilter = new RepositoryFilter(resolver);
Filter viewFilter = new ViewFilter(accessFactory, urls, visibilityCache);
Filter dispatchFilter = new DispatchFilter(filters, servlets);
ServletBinder root = serveRegex(ROOT_REGEX).through(viewFilter);
if (gitwebRedirect != null) {
root.through(gitwebRedirect);
}
root.through(dispatchFilter);
serveRegex(REPO_REGEX).through(repositoryFilter).through(viewFilter).through(dispatchFilter);
serveRegex(REPO_PATH_REGEX).through(repositoryFilter).through(viewFilter).through(dispatchFilter);
initialized = true;
}
Aggregations