| Modifier and Type | Class and Description |
|---|---|
| private class | |
| public static class | ResourceHandler.ResourceContext
Utility class to create a ContextHandler containing a ResourceHandler. |
| Modifier and Type | Field and Description |
|---|---|
| private Resource | |
| private ByteBufferPool | |
| private MimeTypes | |
| private final ResourceService | |
| private Resource | |
| private boolean | |
| private List |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | doStart()
Overrides org. |
| public Resource | |
| private ByteBufferPool | |
| public ByteBufferPool | |
| public String | Returns: the cacheControl header to set on all static content.Get the cacheControl header to set on all static content.. |
| public int | |
| public List | Returns: file extensions that signify that a file is gzip compressed. Eg ".svgz"
|
| public HttpContent. | |
| public MimeTypes | |
| public List | Returns: Precompressed resources formats that can be used to serve compressed variant of resources.
|
| public ResourceService | |
| public Resource | |
| public List | |
| public ResourceService. | |
| public boolean | handle(Request
the HTTP request to handle request, Response the HTTP response to handle response, Callback the callback to complete when the handling is complete callback)Overrides org. Implements org. Invoked to handle the passed HTTP request and response. |
| public boolean | |
| public boolean | Returns: If true, directory listings are returned if no welcome file is found. Else 403 Forbidden.
|
| public boolean | |
| public boolean | |
| protected HttpContent. | |
| protected ResourceService | |
| public void | |
| public void | setBaseResource(Resource
The resourceBase to server content from. If null the
context resource base is used. base)
|
| public void | setBaseResourceAsString(String
The resourceBase to server content from. If null the
context resource base is used. If non-null the base)Resource is created
from ResourceFactory#of(org. for
this context.
|
| public void | setCacheControl(String
the cacheControl header to set on all static content. cacheControl)Set the cacheControl header to set on all static content.. |
| public void | setDirAllowed(boolean
If true, directory listings are returned if no welcome file is found. Else 403 Forbidden. dirAllowed)
|
| public void | |
| public void | |
| public void | setGzipEquivalentFileExtensions(List<String>
file extensions that signify that a file is gzip compressed. Eg ".svgz" gzipEquivalentFileExtensions)Set file extensions that signify that a file is gzip compressed. |
| public void | |
| public void | setPrecompressedFormats(CompressedContentFormat...
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. precompressedFormats)
|
| public void | setPrecompressedFormats(List<CompressedContentFormat>
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. precompressedFormats)
|
| public void | |
| protected ResourceService. | |
| public void | |
| public void | |
| public void | |
| public void |
| _baseResource | back to summary |
|---|---|
| private Resource _baseResource | |
| _byteBufferPool | back to summary |
|---|---|
| private ByteBufferPool _byteBufferPool | |
| _mimeTypes | back to summary |
|---|---|
| private MimeTypes _mimeTypes | |
| _resourceService | back to summary |
|---|---|
| private final ResourceService _resourceService | |
| _styleSheet | back to summary |
|---|---|
| private Resource _styleSheet | |
| _useFileMapping | back to summary |
|---|---|
| private boolean _useFileMapping | |
| _welcomes | back to summary |
|---|---|
| private List<String> _welcomes | |
| ResourceHandler | back to summary |
|---|---|
| public ResourceHandler() | |
| ResourceHandler | back to summary |
|---|---|
| public ResourceHandler(Handler handler) | |
| doStart | back to summary |
|---|---|
| public void doStart() throws Exception Overrides org. Doc from org. Starts the managed lifecycle beans in the order they were added.
| |
| getBaseResource | back to summary |
|---|---|
public Resource getBaseResource()
| |
| getByteBufferPool | back to summary |
|---|---|
| private ByteBufferPool getByteBufferPool(Context context) | |
| getByteBufferPool | back to summary |
|---|---|
| public ByteBufferPool getByteBufferPool() | |
| getCacheControl | back to summary |
|---|---|
| public String getCacheControl() Get the cacheControl header to set on all static content..
| |
| getEncodingCacheSize | back to summary |
|---|---|
| public int getEncodingCacheSize() | |
| getGzipEquivalentFileExtensions | back to summary |
|---|---|
| public List | |
| getHttpContentFactory | back to summary |
|---|---|
| public HttpContent. | |
| getMimeTypes | back to summary |
|---|---|
| public MimeTypes getMimeTypes() | |
| getPrecompressedFormats | back to summary |
|---|---|
public List
| |
| getResourceService | back to summary |
|---|---|
| public ResourceService getResourceService() | |
| getStyleSheet | back to summary |
|---|---|
public Resource getStyleSheet()
| |
| getWelcomeFiles | back to summary |
|---|---|
| public List | |
| getWelcomeMode | back to summary |
|---|---|
| public ResourceService. | |
| handle | back to summary |
|---|---|
| public boolean handle(Request request, Response response, Callback callback) throws Exception Overrides org. Implements org. Doc from org. Invoked to handle the passed HTTP request and response. The request is accepted by returning true, then handling must be concluded by completing the passed callback. The handling may be asynchronous, i.e. this method may return true and complete the given callback later, possibly from a different thread. If this method returns false, then the callback must not be invoked and any mutation on the response reversed. Exceptions thrown by this method may be subsequently handled by an error The simplest implementation is:
public boolean handle(Request request, Response response, Callback callback)
{
callback.succeeded();
return true;
}
A HelloWorld implementation is:
public boolean handle(Request request, Response response, Callback callback)
{
response.write(true, ByteBuffer.wrap("Hello World\n".getBytes(StandardCharsets.UTF_8)), callback);
return true;
}
| |
| isAcceptRanges | back to summary |
|---|---|
public boolean isAcceptRanges()
| |
| isDirAllowed | back to summary |
|---|---|
public boolean isDirAllowed()
| |
| isEtags | back to summary |
|---|---|
public boolean isEtags()
| |
| isUseFileMapping | back to summary |
|---|---|
| public boolean isUseFileMapping() | |
| newHttpContentFactory | back to summary |
|---|---|
| protected HttpContent. | |
| newResourceService | back to summary |
|---|---|
| protected ResourceService newResourceService() | |
| setAcceptRanges | back to summary |
|---|---|
public void setAcceptRanges(boolean acceptRanges)
| |
| setBaseResource | back to summary |
|---|---|
public void setBaseResource(Resource base)
| |
| setBaseResourceAsString | back to summary |
|---|---|
public void setBaseResourceAsString(String base)
| |
| setCacheControl | back to summary |
|---|---|
| public void setCacheControl(String cacheControl) Set the cacheControl header to set on all static content..
| |
| setDirAllowed | back to summary |
|---|---|
public void setDirAllowed(boolean dirAllowed)
| |
| setEncodingCacheSize | back to summary |
|---|---|
| public void setEncodingCacheSize(int encodingCacheSize) | |
| setEtags | back to summary |
|---|---|
public void setEtags(boolean etags)
| |
| setGzipEquivalentFileExtensions | back to summary |
|---|---|
| public void setGzipEquivalentFileExtensions(List<String> gzipEquivalentFileExtensions) Set file extensions that signify that a file is gzip compressed. Eg ".svgz". | |
| setMimeTypes | back to summary |
|---|---|
| public void setMimeTypes(MimeTypes mimeTypes) | |
| setPrecompressedFormats | back to summary |
|---|---|
public void setPrecompressedFormats(CompressedContentFormat... precompressedFormats)
| |
| setPrecompressedFormats | back to summary |
|---|---|
public void setPrecompressedFormats(List<CompressedContentFormat> precompressedFormats)
| |
| setStyleSheet | back to summary |
|---|---|
public void setStyleSheet(Resource styleSheet)
| |
| setupWelcomeFactory | back to summary |
|---|---|
| protected ResourceService. | |
| setUseFileMapping | back to summary |
|---|---|
| public void setUseFileMapping(boolean useFileMapping) | |
| setWelcomeFiles | back to summary |
|---|---|
| public void setWelcomeFiles(String... welcomeFiles) | |
| setWelcomeFiles | back to summary |
|---|---|
| public void setWelcomeFiles(List<String> welcomeFiles) | |
| setWelcomeMode | back to summary |
|---|---|
| public void setWelcomeMode(ResourceService. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected void | rehandleWelcome(Request
the request request, Response the response response, Callback the callback to complete callback, String the welcome target to rehandle to welcomeTarget)Overrides org. Rehandles the given welcome target. |
| HandlerResourceService | back to summary |
|---|---|
| private HandlerResourceService() | |
| rehandleWelcome | back to summary |
|---|---|
| protected void rehandleWelcome(Request request, Response response, Callback callback, String welcomeTarget) throws Exception Overrides org. Doc from org. Rehandles the given welcome target. Implementations should call For example, a request for | |
| Access | Constructor and Description |
|---|---|
| public |
| ResourceContext | back to summary |
|---|---|
| public ResourceContext() | |