public class WebServerFilter
extends org.glassfish.grizzly.filterchain.BaseFilter
| Constructor and Description |
|---|
WebServerFilter(String rootFolder)
Construct a WebServer
|
| Modifier and Type | Method and Description |
|---|---|
org.glassfish.grizzly.filterchain.NextAction |
handleRead(org.glassfish.grizzly.filterchain.FilterChainContext ctx)
The method is called once we have received some
HttpContent. |
public WebServerFilter(String rootFolder)
rootFolder - Root folder in a local filesystem, where server will look
for resourcespublic org.glassfish.grizzly.filterchain.NextAction handleRead(org.glassfish.grizzly.filterchain.FilterChainContext ctx)
throws IOException
HttpContent.
Filter gets HttpContent, which represents a part or complete HTTP
request. If it's just a chunk of a complete HTTP request - filter checks
whether it's the last chunk, if not - swallows content and returns.
If incoming HttpContent represents complete HTTP request or it is
the last HTTP request - it initiates file download and sends the file
asynchronously to the client.handleRead in interface org.glassfish.grizzly.filterchain.FilterhandleRead in class org.glassfish.grizzly.filterchain.BaseFilterctx - Request processing contextNextActionIOExceptionCopyright © 2021 Oracle Corporation. All Rights Reserved.