public class ClientDownloadFilter extends BaseFilter
Constructor and Description |
---|
ClientDownloadFilter(URI uri,
FutureImpl<String> completeFuture)
ClientDownloadFilter constructor
|
Modifier and Type | Method and Description |
---|---|
NextAction |
handleClose(FilterChainContext ctx)
The method is called, when the client connection will get closed.
|
NextAction |
handleConnect(FilterChainContext ctx)
The method is called, when a client connection gets connected to a web
server.
|
NextAction |
handleRead(FilterChainContext ctx)
The method is called, when we receive a
HttpContent from a server. |
createContext, exceptionOccurred, handleAccept, handleEvent, handleWrite, onAdded, onFilterChainChanged, onRemoved
public ClientDownloadFilter(URI uri, FutureImpl<String> completeFuture)
uri
- URI
of a remote resource to downloadcompleteFuture
- download completion handler (FutureImpl
)public NextAction handleConnect(FilterChainContext ctx) throws IOException
handleConnect
in interface Filter
handleConnect
in class BaseFilter
ctx
- Client connect processing contextNextAction
IOException
public NextAction handleRead(FilterChainContext ctx) throws IOException
HttpContent
from a server.
Once we receive one - we save the content chunk to a local file.handleRead
in interface Filter
handleRead
in class BaseFilter
ctx
- Request processing contextNextAction
IOException
public NextAction handleClose(FilterChainContext ctx) throws IOException
handleClose
in interface Filter
handleClose
in class BaseFilter
ctx
- Request processing contextNextAction
IOException
Copyright © 2015 Oracle Corporation. All rights reserved.