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,
ContentType contentType) |
ZeroCopyPost(URI requestURI,
File content,
ContentType contentType) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected HttpEntityEnclosingRequest |
createRequest(URI requestURI,
HttpEntity entity) |
void |
failed(Exception ex) |
HttpRequest |
generateRequest() |
HttpHost |
getTarget() |
boolean |
isRepeatable() |
void |
produceContent(org.apache.http.nio.ContentEncoder encoder,
org.apache.http.nio.IOControl ioctrl) |
void |
requestCompleted(HttpContext context) |
void |
resetRequest() |
public ZeroCopyPost(URI requestURI, File content, ContentType contentType) throws FileNotFoundException
FileNotFoundException
public ZeroCopyPost(String requestURI, File content, ContentType contentType) throws FileNotFoundException
FileNotFoundException
protected HttpEntityEnclosingRequest createRequest(URI requestURI, HttpEntity entity)
public HttpRequest generateRequest() throws IOException, HttpException
generateRequest
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
IOException
HttpException
public HttpHost getTarget()
getTarget
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
public void produceContent(org.apache.http.nio.ContentEncoder encoder, org.apache.http.nio.IOControl ioctrl) throws IOException
produceContent
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
IOException
public void requestCompleted(HttpContext context)
requestCompleted
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
public void failed(Exception ex)
failed
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
public boolean isRepeatable()
isRepeatable
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
public void resetRequest() throws IOException
resetRequest
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2010–2021 The Apache Software Foundation. All rights reserved.