public class ResourceService
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ResourceService.WelcomeFactory |
Modifier and Type | Field and Description |
---|---|
private boolean |
_acceptRanges |
private HttpField |
_cacheControl |
private HttpContent.ContentFactory |
_contentFactory |
private boolean |
_dirAllowed |
private int |
_encodingCacheSize |
private boolean |
_etags |
private java.util.List<java.lang.String> |
_gzipEquivalentFileExtensions |
private boolean |
_pathInfoOnly |
private CompressedContentFormat[] |
_precompressedFormats |
private java.lang.String[] |
_preferredEncodingOrder |
private java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
_preferredEncodingOrderCache |
private boolean |
_redirectWelcome |
private ResourceService.WelcomeFactory |
_welcomeFactory |
private static PreEncodedHttpField |
ACCEPT_RANGES |
private static Logger |
LOG |
Constructor and Description |
---|
ResourceService() |
Modifier and Type | Method and Description |
---|---|
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
private CompressedContentFormat |
getBestPrecompressedContent(java.util.List<java.lang.String> preferredEncodings,
java.util.Collection<CompressedContentFormat> availableFormats) |
HttpField |
getCacheControl() |
HttpContent.ContentFactory |
getContentFactory() |
int |
getEncodingCacheSize() |
java.util.List<java.lang.String> |
getGzipEquivalentFileExtensions() |
CompressedContentFormat[] |
getPrecompressedFormats() |
private java.util.List<java.lang.String> |
getPreferredEncodingOrder(javax.servlet.http.HttpServletRequest request) |
ResourceService.WelcomeFactory |
getWelcomeFactory() |
private boolean |
hasDefinedRange(java.util.Enumeration<java.lang.String> reqRanges) |
boolean |
isAcceptRanges() |
boolean |
isDirAllowed() |
boolean |
isEtags() |
protected boolean |
isGzippedContent(java.lang.String path) |
boolean |
isPathInfoOnly() |
boolean |
isRedirectWelcome() |
protected void |
notFound(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected boolean |
passConditionalHeaders(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
HttpContent content) |
protected void |
putHeaders(javax.servlet.http.HttpServletResponse response,
HttpContent content,
long contentLength) |
protected boolean |
sendData(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
boolean include,
HttpContent content,
java.util.Enumeration<java.lang.String> reqRanges) |
protected void |
sendDirectory(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Resource resource,
java.lang.String pathInContext) |
protected void |
sendWelcome(HttpContent content,
java.lang.String pathInContext,
boolean endsWithSlash,
boolean included,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
setAcceptRanges(boolean acceptRanges) |
void |
setCacheControl(HttpField cacheControl) |
void |
setContentFactory(HttpContent.ContentFactory contentFactory) |
void |
setDirAllowed(boolean dirAllowed) |
void |
setEncodingCacheSize(int encodingCacheSize) |
void |
setEtags(boolean etags) |
void |
setGzipEquivalentFileExtensions(java.util.List<java.lang.String> gzipEquivalentFileExtensions) |
void |
setPathInfoOnly(boolean pathInfoOnly) |
void |
setPrecompressedFormats(CompressedContentFormat[] precompressedFormats) |
void |
setRedirectWelcome(boolean redirectWelcome) |
void |
setWelcomeFactory(ResourceService.WelcomeFactory welcomeFactory) |
private static final Logger LOG
private static final PreEncodedHttpField ACCEPT_RANGES
private HttpContent.ContentFactory _contentFactory
private ResourceService.WelcomeFactory _welcomeFactory
private boolean _acceptRanges
private boolean _dirAllowed
private boolean _redirectWelcome
private CompressedContentFormat[] _precompressedFormats
private java.lang.String[] _preferredEncodingOrder
private final java.util.Map<java.lang.String,java.util.List<java.lang.String>> _preferredEncodingOrderCache
private int _encodingCacheSize
private boolean _pathInfoOnly
private boolean _etags
private HttpField _cacheControl
private java.util.List<java.lang.String> _gzipEquivalentFileExtensions
public HttpContent.ContentFactory getContentFactory()
public void setContentFactory(HttpContent.ContentFactory contentFactory)
public ResourceService.WelcomeFactory getWelcomeFactory()
public void setWelcomeFactory(ResourceService.WelcomeFactory welcomeFactory)
public boolean isAcceptRanges()
public void setAcceptRanges(boolean acceptRanges)
public boolean isDirAllowed()
public void setDirAllowed(boolean dirAllowed)
public boolean isRedirectWelcome()
public void setRedirectWelcome(boolean redirectWelcome)
public CompressedContentFormat[] getPrecompressedFormats()
public void setPrecompressedFormats(CompressedContentFormat[] precompressedFormats)
public void setEncodingCacheSize(int encodingCacheSize)
public int getEncodingCacheSize()
public boolean isPathInfoOnly()
public void setPathInfoOnly(boolean pathInfoOnly)
public boolean isEtags()
public void setEtags(boolean etags)
public HttpField getCacheControl()
public void setCacheControl(HttpField cacheControl)
public java.util.List<java.lang.String> getGzipEquivalentFileExtensions()
public void setGzipEquivalentFileExtensions(java.util.List<java.lang.String> gzipEquivalentFileExtensions)
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
private java.util.List<java.lang.String> getPreferredEncodingOrder(javax.servlet.http.HttpServletRequest request)
private CompressedContentFormat getBestPrecompressedContent(java.util.List<java.lang.String> preferredEncodings, java.util.Collection<CompressedContentFormat> availableFormats)
protected void sendWelcome(HttpContent content, java.lang.String pathInContext, boolean endsWithSlash, boolean included, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected boolean isGzippedContent(java.lang.String path)
private boolean hasDefinedRange(java.util.Enumeration<java.lang.String> reqRanges)
protected void notFound(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
java.io.IOException
protected boolean passConditionalHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, HttpContent content) throws java.io.IOException
java.io.IOException
protected void sendDirectory(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Resource resource, java.lang.String pathInContext) throws java.io.IOException
java.io.IOException
protected boolean sendData(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean include, HttpContent content, java.util.Enumeration<java.lang.String> reqRanges) throws java.io.IOException
java.io.IOException
protected void putHeaders(javax.servlet.http.HttpServletResponse response, HttpContent content, long contentLength)