Search in sources :

Example 1 with ServletBinder

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;
}
Also used : MetaFilter(org.eclipse.jgit.http.server.glue.MetaFilter) Filter(javax.servlet.Filter) ServletBinder(org.eclipse.jgit.http.server.glue.ServletBinder)

Aggregations

Filter (javax.servlet.Filter)1 MetaFilter (org.eclipse.jgit.http.server.glue.MetaFilter)1 ServletBinder (org.eclipse.jgit.http.server.glue.ServletBinder)1