public class WebServerFilter extends BaseFilter
Constructor and Description |
---|
WebServerFilter(String rootFolder)
Construct a WebServer
|
Modifier and Type | Method and Description |
---|---|
NextAction |
handleRead(FilterChainContext ctx)
The method is called once we have received some
HttpContent . |
createContext, exceptionOccurred, handleAccept, handleClose, handleConnect, handleEvent, handleWrite, onAdded, onFilterChainChanged, onRemoved
public WebServerFilter(String rootFolder)
rootFolder
- Root folder in a local filesystem, where server will look
for resourcespublic NextAction handleRead(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 Filter
handleRead
in class BaseFilter
ctx
- Request processing contextNextAction
IOException
Copyright © 2014 Oracle Corporation. All rights reserved.