public class ZeroCopyPost extends Object
HttpAsyncRequestProducer implementation
that generates an HTTP POST request enclosing content of a file.
The request content will be streamed out directly from the underlying file
without an intermediate in-memory buffer.| Constructor and Description |
|---|
ZeroCopyPost(String requestURI,
File content,
org.apache.http.entity.ContentType contentType) |
ZeroCopyPost(URI requestURI,
File content,
org.apache.http.entity.ContentType contentType) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected org.apache.http.HttpEntityEnclosingRequest |
createRequest(URI requestURI,
org.apache.http.HttpEntity entity) |
void |
failed(Exception ex) |
org.apache.http.HttpRequest |
generateRequest() |
org.apache.http.HttpHost |
getTarget() |
boolean |
isRepeatable() |
void |
produceContent(org.apache.http.nio.ContentEncoder encoder,
org.apache.http.nio.IOControl ioctrl) |
void |
requestCompleted(org.apache.http.protocol.HttpContext context) |
void |
resetRequest() |
public ZeroCopyPost(URI requestURI, File content, org.apache.http.entity.ContentType contentType) throws FileNotFoundException
FileNotFoundExceptionpublic ZeroCopyPost(String requestURI, File content, org.apache.http.entity.ContentType contentType) throws FileNotFoundException
FileNotFoundExceptionprotected org.apache.http.HttpEntityEnclosingRequest createRequest(URI requestURI, org.apache.http.HttpEntity entity)
public org.apache.http.HttpRequest generateRequest()
throws IOException,
org.apache.http.HttpException
generateRequest in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerIOExceptionorg.apache.http.HttpExceptionpublic org.apache.http.HttpHost getTarget()
getTarget in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerpublic void produceContent(org.apache.http.nio.ContentEncoder encoder,
org.apache.http.nio.IOControl ioctrl)
throws IOException
produceContent in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerIOExceptionpublic void requestCompleted(org.apache.http.protocol.HttpContext context)
requestCompleted in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerpublic void failed(Exception ex)
failed in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerpublic boolean isRepeatable()
isRepeatable in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerpublic void resetRequest()
throws IOException
resetRequest in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2010–2016 The Apache Software Foundation. All rights reserved.