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.RandomAccessFileaccessfileprivate org.apache.http.entity.ContentTypecontentTypeprivate java.io.Filefileprivate java.nio.channels.FileChannelfileChannelprivate longidxprivate java.net.URIrequestURI
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseZeroCopyRequestProducer(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 voidclose()private voidcloseChannel()protected abstract org.apache.http.HttpEntityEnclosingRequestcreateRequest(java.net.URI requestURI, org.apache.http.HttpEntity entity)voidfailed(java.lang.Exception ex)org.apache.http.HttpRequestgenerateRequest()org.apache.http.HttpHostgetTarget()booleanisRepeatable()voidproduceContent(org.apache.http.nio.ContentEncoder encoder, org.apache.http.nio.IOControl ioctrl)voidrequestCompleted(org.apache.http.protocol.HttpContext context)voidresetRequest()
-
-
-
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:
generateRequestin interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer- Throws:
java.io.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 java.io.IOException- Specified by:
produceContentin interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer- Throws:
java.io.IOException
-
requestCompleted
public void requestCompleted(org.apache.http.protocol.HttpContext context)
- Specified by:
requestCompletedin interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
failed
public void failed(java.lang.Exception ex)
- Specified by:
failedin interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
isRepeatable
public boolean isRepeatable()
- Specified by:
isRepeatablein interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
resetRequest
public void resetRequest() throws java.io.IOException- Specified by:
resetRequestin interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-