abstract class BaseZeroCopyRequestProducer
extends java.lang.Object
implements org.apache.http.nio.protocol.HttpAsyncRequestProducer
| Modifier and Type | Field and Description |
|---|---|
private java.io.RandomAccessFile |
accessfile |
private org.apache.http.entity.ContentType |
contentType |
private java.io.File |
file |
private java.nio.channels.FileChannel |
fileChannel |
private long |
idx |
private java.net.URI |
requestURI |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseZeroCopyRequestProducer(java.net.URI requestURI,
java.io.File file,
org.apache.http.entity.ContentType contentType) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
private void |
closeChannel() |
protected abstract org.apache.http.HttpEntityEnclosingRequest |
createRequest(java.net.URI requestURI,
org.apache.http.HttpEntity entity) |
void |
failed(java.lang.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() |
private final java.net.URI requestURI
private final java.io.File file
private final java.io.RandomAccessFile accessfile
private final org.apache.http.entity.ContentType contentType
private java.nio.channels.FileChannel fileChannel
private long idx
protected BaseZeroCopyRequestProducer(java.net.URI requestURI,
java.io.File file,
org.apache.http.entity.ContentType contentType)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionprivate void closeChannel()
throws java.io.IOException
java.io.IOExceptionprotected abstract org.apache.http.HttpEntityEnclosingRequest createRequest(java.net.URI requestURI,
org.apache.http.HttpEntity entity)
public org.apache.http.HttpRequest generateRequest()
throws java.io.IOException,
org.apache.http.HttpException
generateRequest in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerjava.io.IOExceptionorg.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 java.io.IOException
produceContent in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerjava.io.IOExceptionpublic void requestCompleted(org.apache.http.protocol.HttpContext context)
requestCompleted in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerpublic void failed(java.lang.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 java.io.IOException
resetRequest in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException