Class BaseZeroCopyRequestProducer
- java.lang.Object
-
- org.apache.http.nio.client.methods.BaseZeroCopyRequestProducer
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,org.apache.http.nio.protocol.HttpAsyncRequestProducer
- Direct Known Subclasses:
ZeroCopyPost
,ZeroCopyPut
abstract class BaseZeroCopyRequestProducer extends java.lang.Object implements org.apache.http.nio.protocol.HttpAsyncRequestProducer
-
-
Field Summary
Fields Modifier and Type Field 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
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseZeroCopyRequestProducer(java.net.URI requestURI, java.io.File file, org.apache.http.entity.ContentType contentType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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()
-
-
-
Field Detail
-
requestURI
private final java.net.URI requestURI
-
file
private final java.io.File file
-
accessfile
private final java.io.RandomAccessFile accessfile
-
contentType
private final org.apache.http.entity.ContentType contentType
-
fileChannel
private java.nio.channels.FileChannel fileChannel
-
idx
private long idx
-
-
Method Detail
-
closeChannel
private void closeChannel() throws java.io.IOException
- Throws:
java.io.IOException
-
createRequest
protected abstract org.apache.http.HttpEntityEnclosingRequest createRequest(java.net.URI requestURI, org.apache.http.HttpEntity entity)
-
generateRequest
public org.apache.http.HttpRequest generateRequest() throws java.io.IOException, org.apache.http.HttpException
- Specified by:
generateRequest
in interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
- Throws:
java.io.IOException
org.apache.http.HttpException
-
getTarget
public org.apache.http.HttpHost getTarget()
- Specified by:
getTarget
in interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
produceContent
public void produceContent(org.apache.http.nio.ContentEncoder encoder, org.apache.http.nio.IOControl ioctrl) throws java.io.IOException
- Specified by:
produceContent
in interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
- Throws:
java.io.IOException
-
requestCompleted
public void requestCompleted(org.apache.http.protocol.HttpContext context)
- Specified by:
requestCompleted
in interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
failed
public void failed(java.lang.Exception ex)
- Specified by:
failed
in interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
isRepeatable
public boolean isRepeatable()
- Specified by:
isRepeatable
in interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
resetRequest
public void resetRequest() throws java.io.IOException
- Specified by:
resetRequest
in interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-