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.FileNotFoundException
private void closeChannel() throws java.io.IOException
java.io.IOException
protected 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.HttpAsyncRequestProducer
java.io.IOException
org.apache.http.HttpException
public org.apache.http.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 java.io.IOException
produceContent
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
java.io.IOException
public void requestCompleted(org.apache.http.protocol.HttpContext context)
requestCompleted
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
public void failed(java.lang.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 java.io.IOException
resetRequest
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException