public class ResourceHandler extends HandlerWrapper implements ResourceFactory, ResourceService.WelcomeFactory
AbstractHandler.ErrorDispatchHandlerAbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.ListenerContainer.InheritedListener, Container.Listener_handlerFAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING| Constructor and Description |
|---|
ResourceHandler() |
ResourceHandler(ResourceService resourceService) |
destroy, expandChildren, getHandler, getHandlers, insertHandler, setHandlerexpandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServerdoError, doStop, dumpThis, getServeraddBean, addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic ResourceHandler(ResourceService resourceService)
public ResourceHandler()
public String getWelcomeFile(String pathInContext)
ResourceService.WelcomeFactoryResource.getWelcomeFile in interface ResourceService.WelcomeFactorypathInContext - the path of the requestpublic void doStart()
throws Exception
doStart in class AbstractHandlerExceptionpublic Resource getBaseResource()
public String getCacheControl()
public List<String> getGzipEquivalentFileExtensions()
public MimeTypes getMimeTypes()
@Deprecated public int getMinAsyncContentLength()
ServletResponse.getBufferSize() as the minimum length.@Deprecated public int getMinMemoryMappedContentLength()
public Resource getResource(String path)
getResource in interface ResourceFactorypublic String getResourceBase()
public Resource getStylesheet()
public String[] getWelcomeFiles()
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
Handlerhandle in interface Handlerhandle in class HandlerWrappertarget - The target of the request - either a URI or a name.baseRequest - The original unwrapped request object.request - The request either as the Request object or a wrapper of that request. The
HttpConnection.getCurrentConnection().getHttpChannel().getRequest()
method can be used access the Request object if required.response - The response as the Response object or a wrapper of that request. The
HttpConnection.getCurrentConnection().getHttpChannel().getResponse()
method can be used access the Response object if required.IOException - if unable to handle the request or response processingServletException - if unable to handle the request or response due to underlying servlet issuepublic boolean isAcceptRanges()
public boolean isDirAllowed()
public boolean isDirectoriesListed()
public boolean isEtags()
@Deprecated public boolean isGzip()
public CompressedContentFormat[] getPrecompressedFormats()
public boolean isPathInfoOnly()
public boolean isRedirectWelcome()
public void setAcceptRanges(boolean acceptRanges)
acceptRanges - If true, range requests and responses are supportedpublic void setBaseResource(Resource base)
base - The resourceBase to server content from. If null the
context resource base is used.public void setCacheControl(String cacheControl)
cacheControl - the cacheControl header to set on all static content.public void setDirAllowed(boolean dirAllowed)
dirAllowed - If true, directory listings are returned if no welcome file is found. Else 403 Forbidden.public void setDirectoriesListed(boolean directory)
directory - true if directories are listed.public void setEtags(boolean etags)
etags - True if ETag processing is done@Deprecated public void setGzip(boolean gzip)
gzip - If set to true, then static content will be served as gzip content encoded if a matching resource is found ending with ".gz"public void setGzipEquivalentFileExtensions(List<String> gzipEquivalentFileExtensions)
gzipEquivalentFileExtensions - file extensions that signify that a file is gzip compressed. Eg ".svgz"public void setPrecompressedFormats(CompressedContentFormat[] precompressedFormats)
precompressedFormats - The list of precompresed formats to serve in encoded format if matching resource found.
For example serve gzip encoded file if ".gz" suffixed resource is found.public void setMimeTypes(MimeTypes mimeTypes)
@Deprecated public void setMinAsyncContentLength(int minAsyncContentLength)
minAsyncContentLength - The minimum size in bytes of the content before asynchronous handling is used, or -1 for no async handling or 0 for using
ServletResponse.getBufferSize() as the minimum length.@Deprecated public void setMinMemoryMappedContentLength(int minMemoryMappedFileSize)
minMemoryMappedFileSize - the minimum size in bytes of a file resource that will be served using a memory mapped buffer, or -1 for no memory mapped buffers.public void setPathInfoOnly(boolean pathInfoOnly)
pathInfoOnly - true, only the path info will be applied to the resourceBasepublic void setRedirectWelcome(boolean redirectWelcome)
redirectWelcome - If true, welcome files are redirected rather than forwarded to.
redirection is always used if the ResourceHandler is not scoped by
a ContextHandlerpublic void setResourceBase(String resourceBase)
resourceBase - The base resource as a string.public void setStylesheet(String stylesheet)
stylesheet - The location of the stylesheet to be used as a String.public void setWelcomeFiles(String[] welcomeFiles)
Copyright © 1995–2017 Webtide. All rights reserved.