Class ZeroCopyPost
java.lang.Object
org.apache.http.nio.client.methods.ZeroCopyPost
- All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.http.nio.protocol.HttpAsyncRequestProducer
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.- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionZeroCopyPost(String requestURI, File content, org.apache.http.entity.ContentType contentType) ZeroCopyPost(URI requestURI, File content, org.apache.http.entity.ContentType contentType) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected org.apache.http.HttpEntityEnclosingRequestcreateRequest(URI requestURI, org.apache.http.HttpEntity entity) voidorg.apache.http.HttpRequestorg.apache.http.HttpHostbooleanvoidproduceContent(org.apache.http.nio.ContentEncoder encoder, org.apache.http.nio.IOControl ioctrl) voidrequestCompleted(org.apache.http.protocol.HttpContext context) void
-
Constructor Details
-
ZeroCopyPost
public ZeroCopyPost(URI requestURI, File content, org.apache.http.entity.ContentType contentType) throws FileNotFoundException - Throws:
FileNotFoundException
-
ZeroCopyPost
public ZeroCopyPost(String requestURI, File content, org.apache.http.entity.ContentType contentType) throws FileNotFoundException - Throws:
FileNotFoundException
-
-
Method Details
-
createRequest
protected org.apache.http.HttpEntityEnclosingRequest createRequest(URI requestURI, org.apache.http.HttpEntity entity) -
generateRequest
public org.apache.http.HttpRequest generateRequest() throws IOException, org.apache.http.HttpException- Specified by:
generateRequestin interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer- Throws:
IOExceptionorg.apache.http.HttpException
-
getTarget
public org.apache.http.HttpHost getTarget()- Specified by:
getTargetin interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
produceContent
public void produceContent(org.apache.http.nio.ContentEncoder encoder, org.apache.http.nio.IOControl ioctrl) throws IOException - Specified by:
produceContentin interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer- Throws:
IOException
-
requestCompleted
public void requestCompleted(org.apache.http.protocol.HttpContext context) - Specified by:
requestCompletedin interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
failed
- Specified by:
failedin interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
isRepeatable
public boolean isRepeatable()- Specified by:
isRepeatablein interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
resetRequest
- Specified by:
resetRequestin interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-