public abstract class ResourceServlet
extends javax.servlet.http.HttpServlet
Supports caching, ETags, basic content type detection, and limited gzip compression.
Modifier | Constructor and Description |
---|---|
protected |
ResourceServlet(com.google.common.cache.Cache<java.nio.file.Path,com.google.gerrit.httpd.raw.ResourceServlet.Resource> cache,
boolean refresh) |
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String |
contentType(java.lang.String name) |
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse rsp) |
protected java.nio.file.attribute.FileTime |
getLastModifiedTime(java.nio.file.Path p) |
protected abstract java.nio.file.Path |
getResourcePath(java.lang.String pathInfo)
Get the resource path on the filesystem that should be served for this
request.
|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
protected ResourceServlet(com.google.common.cache.Cache<java.nio.file.Path,com.google.gerrit.httpd.raw.ResourceServlet.Resource> cache, boolean refresh)
protected static java.lang.String contentType(java.lang.String name)
protected abstract java.nio.file.Path getResourcePath(java.lang.String pathInfo)
pathInfo
- result of HttpServletRequest.getPathInfo()
.protected java.nio.file.attribute.FileTime getLastModifiedTime(java.nio.file.Path p) throws java.io.IOException
java.io.IOException
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp) throws java.io.IOException
doGet
in class javax.servlet.http.HttpServlet
java.io.IOException