use of com.google.gitiles.RootedDocServlet in project gitiles by GerritCodeReview.
the class DevServer method createRootedDocServlet.
private Servlet createRootedDocServlet(DebugRenderer renderer, String docRoot) {
File docRepo = new File(docRoot);
FileKey repoKey = FileKey.exact(docRepo, FS.DETECTED);
RepositoryResolver<HttpServletRequest> resolver = (req, name) -> {
try {
return RepositoryCache.open(repoKey, true);
} catch (IOException e) {
throw new RepositoryNotFoundException(repoKey.getFile(), e);
}
};
return new RootedDocServlet(resolver, new RootedDocAccess(docRepo), renderer);
}
Aggregations