HttpHandler implementations, which processes requests to a static resources.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private volatile int | |
| private volatile boolean | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected static void | |
| public final boolean | |
| protected String | |
| protected abstract boolean | |
| public boolean | Returns: true if this StaticHttpHandler has been configured to use file cache to serve static resources, or false otherwise.Returns true if this StaticHttpHandler has been configured to use file cache to serve static resources, or false otherwise. |
| protected FileCacheFilter | |
| protected void | onMissingResource(final Request
the request, final Response Requestthe response)ResponseThe method will be called, if the static resource requested by the |
| protected static void | |
| public static void | |
| private static void | |
| private static void | |
| public void | service(final Request
the request, final Response Requestthe response)ResponseImplements abstract org. Based on the |
| public void | setFileCacheEnabled(boolean
true to configure this StaticHttpHandler to use file cache to serve
static resources, or false otherwise. isFileCacheEnabled)Set true to configure this StaticHttpHandler to use file cache to serve static resources, or false otherwise. |
| fileCacheFilterIdx | back to summary |
|---|---|
| private volatile int fileCacheFilterIdx | |
| isFileCacheEnabled | back to summary |
|---|---|
| private volatile boolean isFileCacheEnabled | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| StaticHttpHandlerBase | back to summary |
|---|---|
| public StaticHttpHandlerBase() | |
| addCachingHeaders | back to summary |
|---|---|
| protected static void addCachingHeaders(final Response response, final File file) | |
| addToFileCache | back to summary |
|---|---|
| public final boolean addToFileCache(final Request req, final Response res, final File resource) | |
| getRelativeURI | back to summary |
|---|---|
| protected String getRelativeURI(final Request request) throws Exception | |
| handle | back to summary |
|---|---|
| protected abstract boolean handle(final String uri, final Request request, final Response response) throws Exception Lookup a resource based on the request URI, and process it. | |
| isFileCacheEnabled | back to summary |
|---|---|
| public boolean isFileCacheEnabled() Returns true if this StaticHttpHandler has been configured to use file cache to serve static
resources, or false otherwise.
Please note, even though this StaticHttpHandler might be configured to use file cache, file cache itself might be
disabled
| |
| lookupFileCache | back to summary |
|---|---|
| protected FileCacheFilter lookupFileCache(final FilterChainContext fcContext) | |
| onMissingResource | back to summary |
|---|---|
| protected void onMissingResource(final Request request, final Response response) throws Exception The method will be called, if the static resource requested by the | |
| pickupContentType | back to summary |
|---|---|
| protected static void pickupContentType(final Response response, final String path) | |
| sendFile | back to summary |
|---|---|
| public static void sendFile(final Response response, final File file) throws IOException | |
| sendUsingBuffers | back to summary |
|---|---|
| private static void sendUsingBuffers(final Response response, final File file) throws FileNotFoundException, IOException | |
| sendZeroCopy | back to summary |
|---|---|
| private static void sendZeroCopy(final Response response, final File file) throws IOException | |
| service | back to summary |
|---|---|
| public void service(final Request request, final Response response) throws Exception Implements abstract org. Based on the | |
| setFileCacheEnabled | back to summary |
|---|---|
| public void setFileCacheEnabled(boolean isFileCacheEnabled) Set true to configure this StaticHttpHandler to use file cache to serve static resources, or
false otherwise.
Please note, even though this StaticHttpHandler might be configured to use file cache, file cache itself might be
disabled
| |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final FileChannel | |
| private final MemoryManager | |
| private final NIOOutputStream | |
| private final Response | |
| private volatile long |
| Access | Constructor and Description |
|---|---|
| pack-priv | NonBlockingDownloadHandler(final Response response, final NIOOutputStream outputStream, final File file, final int chunkSize)
|
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | onError(Throwable t)
Implements org. Invoked when an error occurs processing the request asynchronously. |
| public void | onWritePossible()
Implements org. This callback will be invoked when the requirements as dictated by writer are met. |
| private boolean |
| chunkSize | back to summary |
|---|---|
| private final int chunkSize | |
| fileChannel | back to summary |
|---|---|
| private final FileChannel fileChannel | |
| mm | back to summary |
|---|---|
| private final MemoryManager<E extends Buffer> mm | |
| outputStream | back to summary |
|---|---|
| private final NIOOutputStream outputStream | |
| response | back to summary |
|---|---|
| private final Response response | |
| size | back to summary |
|---|---|
| private volatile long size | |
| NonBlockingDownloadHandler | back to summary |
|---|---|
| pack-priv NonBlockingDownloadHandler(final Response response, final NIOOutputStream outputStream, final File file, final int chunkSize) | |
| complete | back to summary |
|---|---|
| private void complete(final boolean isError) Complete the download | |
| onError | back to summary |
|---|---|
| public void onError(Throwable t) Implements org. Doc from org. Invoked when an error occurs processing the request asynchronously.
| |
| onWritePossible | back to summary |
|---|---|
| public void onWritePossible() throws Exception Implements org. Doc from org. This callback will be invoked when the requirements as dictated by writer are met.
| |
| sendChunk | back to summary |
|---|---|
| private boolean sendChunk() throws IOException Send next CHUNK_SIZE of file | |