public class ResourceHandler extends HandlerWrapper
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener_handler| Constructor and Description |
|---|
ResourceHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDirectory(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.eclipse.jetty.util.resource.Resource resource) |
protected void |
doResponseHeaders(javax.servlet.http.HttpServletResponse response,
org.eclipse.jetty.util.resource.Resource resource,
String mimeType)
Set the response headers.
|
void |
doStart() |
org.eclipse.jetty.util.resource.Resource |
getBaseResource() |
String |
getCacheControl() |
MimeTypes |
getMimeTypes() |
int |
getMinAsyncContentLength()
Get the minimum content length for async handling.
|
int |
getMinMemoryMappedContentLength()
Get minimum memory mapped file content length.
|
protected org.eclipse.jetty.util.resource.Resource |
getResource(javax.servlet.http.HttpServletRequest request) |
org.eclipse.jetty.util.resource.Resource |
getResource(String path) |
String |
getResourceBase() |
org.eclipse.jetty.util.resource.Resource |
getStylesheet() |
protected org.eclipse.jetty.util.resource.Resource |
getWelcome(org.eclipse.jetty.util.resource.Resource directory) |
String[] |
getWelcomeFiles() |
void |
handle(String target,
Request baseRequest,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle a request.
|
boolean |
isDirectoriesListed()
Get the directory option.
|
boolean |
isEtags() |
void |
setBaseResource(org.eclipse.jetty.util.resource.Resource base) |
void |
setCacheControl(String cacheControl) |
void |
setDirectoriesListed(boolean directory)
Set the directory.
|
void |
setEtags(boolean etags) |
void |
setMimeTypes(MimeTypes mimeTypes) |
void |
setMinAsyncContentLength(int minAsyncContentLength)
Set the minimum content length for async handling.
|
void |
setMinMemoryMappedContentLength(int minMemoryMappedFileSize)
Set minimum memory mapped file content length.
|
void |
setResourceBase(String resourceBase) |
void |
setStylesheet(String stylesheet) |
void |
setWelcomeFiles(String[] welcomeFiles) |
destroy, expandChildren, getHandler, getHandlers, setHandler, setServerexpandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClassdoStop, 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, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic MimeTypes getMimeTypes()
public void setMimeTypes(MimeTypes mimeTypes)
public boolean isDirectoriesListed()
public void setDirectoriesListed(boolean directory)
directory - true if directories are listed.public int getMinMemoryMappedContentLength()
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 int getMinAsyncContentLength()
ServletResponse.getBufferSize() as the minimum length.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.public boolean isEtags()
public void setEtags(boolean etags)
etags - True if ETag processing is donepublic void doStart()
throws Exception
doStart in class AbstractHandlerExceptionpublic org.eclipse.jetty.util.resource.Resource getBaseResource()
public String getResourceBase()
public void setBaseResource(org.eclipse.jetty.util.resource.Resource base)
base - The resourceBase to set.public void setResourceBase(String resourceBase)
resourceBase - The base resource as a string.public org.eclipse.jetty.util.resource.Resource getStylesheet()
public void setStylesheet(String stylesheet)
stylesheet - The location of the stylesheet to be used as a String.public String getCacheControl()
public void setCacheControl(String cacheControl)
cacheControl - the cacheControl header to set on all static content.public org.eclipse.jetty.util.resource.Resource getResource(String path) throws MalformedURLException
MalformedURLExceptionprotected org.eclipse.jetty.util.resource.Resource getResource(javax.servlet.http.HttpServletRequest request)
throws MalformedURLException
MalformedURLExceptionpublic String[] getWelcomeFiles()
public void setWelcomeFiles(String[] welcomeFiles)
protected org.eclipse.jetty.util.resource.Resource getWelcome(org.eclipse.jetty.util.resource.Resource directory)
throws MalformedURLException,
IOException
MalformedURLExceptionIOExceptionpublic void handle(String target, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.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 HttpChannel.getCurrentHttpChannel()
method can be used access the Request object if required.response - The response as the Response
object or a wrapper of that request. The HttpChannel.getCurrentHttpChannel()
method can be used access the Response object if required.IOExceptionjavax.servlet.ServletExceptionprotected void doDirectory(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.eclipse.jetty.util.resource.Resource resource)
throws IOException
IOExceptionprotected void doResponseHeaders(javax.servlet.http.HttpServletResponse response,
org.eclipse.jetty.util.resource.Resource resource,
String mimeType)
response - resource - mimeType - Copyright © 1995-2020 Webtide. All Rights Reserved.