Class BaseZeroCopyRequestProducer
java.lang.Object
org.apache.http.nio.client.methods.BaseZeroCopyRequestProducer
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.http.nio.protocol.HttpAsyncRequestProducer
- Direct Known Subclasses:
ZeroCopyPost
,ZeroCopyPut
abstract class BaseZeroCopyRequestProducer
extends Object
implements org.apache.http.nio.protocol.HttpAsyncRequestProducer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RandomAccessFile
private final org.apache.http.entity.ContentType
private final File
private FileChannel
private long
private final URI
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseZeroCopyRequestProducer
(URI requestURI, File file, org.apache.http.entity.ContentType contentType) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private void
protected abstract org.apache.http.HttpEntityEnclosingRequest
createRequest
(URI requestURI, org.apache.http.HttpEntity entity) void
org.apache.http.HttpRequest
org.apache.http.HttpHost
boolean
void
produceContent
(org.apache.http.nio.ContentEncoder encoder, org.apache.http.nio.IOControl ioctrl) void
requestCompleted
(org.apache.http.protocol.HttpContext context) void
-
Field Details
-
requestURI
-
file
-
accessfile
-
contentType
private final org.apache.http.entity.ContentType contentType -
fileChannel
-
idx
private long idx
-
-
Constructor Details
-
BaseZeroCopyRequestProducer
protected BaseZeroCopyRequestProducer(URI requestURI, File file, org.apache.http.entity.ContentType contentType) throws FileNotFoundException - Throws:
FileNotFoundException
-
-
Method Details
-
closeChannel
- Throws:
IOException
-
createRequest
protected abstract org.apache.http.HttpEntityEnclosingRequest createRequest(URI requestURI, org.apache.http.HttpEntity entity) -
generateRequest
public org.apache.http.HttpRequest generateRequest() throws IOException, org.apache.http.HttpException- Specified by:
generateRequest
in interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
- Throws:
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 IOException - Specified by:
produceContent
in interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
- Throws:
IOException
-
requestCompleted
public void requestCompleted(org.apache.http.protocol.HttpContext context) - Specified by:
requestCompleted
in interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
-
failed
- 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
- Specified by:
resetRequest
in interfaceorg.apache.http.nio.protocol.HttpAsyncRequestProducer
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-