Package org.apache.http.impl.execchain
Class ResponseEntityProxy
java.lang.Object
org.apache.http.entity.HttpEntityWrapper
org.apache.http.impl.execchain.ResponseEntityProxy
- All Implemented Interfaces:
EofSensorWatcher
,org.apache.http.HttpEntity
class ResponseEntityProxy
extends org.apache.http.entity.HttpEntityWrapper
implements EofSensorWatcher
A wrapper class for
HttpEntity
enclosed in a response message.- Since:
- 4.3
-
Field Summary
FieldsFields inherited from class org.apache.http.entity.HttpEntityWrapper
wrappedEntity
-
Constructor Summary
ConstructorsConstructorDescriptionResponseEntityProxy
(org.apache.http.HttpEntity entity, ConnectionHolder connHolder) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
cleanup()
void
static void
enchance
(org.apache.http.HttpResponse response, ConnectionHolder connHolder) boolean
eofDetected
(InputStream wrapped) Indicates that EOF is detected.boolean
void
boolean
streamAbort
(InputStream wrapped) Indicates that thestream
is aborted.boolean
streamClosed
(InputStream wrapped) Indicates that thestream
is closed.toString()
void
writeTo
(OutputStream outStream) Methods inherited from class org.apache.http.entity.HttpEntityWrapper
getContentEncoding, getContentLength, getContentType, isChunked, isStreaming
-
Field Details
-
connHolder
-
-
Constructor Details
-
ResponseEntityProxy
ResponseEntityProxy(org.apache.http.HttpEntity entity, ConnectionHolder connHolder)
-
-
Method Details
-
enchance
-
cleanup
- Throws:
IOException
-
abortConnection
private void abortConnection() -
releaseConnection
public void releaseConnection() -
isRepeatable
public boolean isRepeatable()- Specified by:
isRepeatable
in interfaceorg.apache.http.HttpEntity
- Overrides:
isRepeatable
in classorg.apache.http.entity.HttpEntityWrapper
-
getContent
- Specified by:
getContent
in interfaceorg.apache.http.HttpEntity
- Overrides:
getContent
in classorg.apache.http.entity.HttpEntityWrapper
- Throws:
IOException
-
consumeContent
- Specified by:
consumeContent
in interfaceorg.apache.http.HttpEntity
- Overrides:
consumeContent
in classorg.apache.http.entity.HttpEntityWrapper
- Throws:
IOException
-
writeTo
- Specified by:
writeTo
in interfaceorg.apache.http.HttpEntity
- Overrides:
writeTo
in classorg.apache.http.entity.HttpEntityWrapper
- Throws:
IOException
-
eofDetected
Description copied from interface:EofSensorWatcher
Indicates that EOF is detected.- Specified by:
eofDetected
in interfaceEofSensorWatcher
- Parameters:
wrapped
- the underlying stream which has reached EOF- Returns:
true
ifwrapped
should be closed,false
if it should be left alone- Throws:
IOException
- in case of an IO problem, for example if the watcher itself closes the underlying stream. The caller will leave the wrapped stream alone, as iffalse
was returned.
-
streamClosed
Description copied from interface:EofSensorWatcher
Indicates that thestream
is closed. This method will be called only if EOF was not detected before closing. Otherwise,eofDetected
is called.- Specified by:
streamClosed
in interfaceEofSensorWatcher
- Parameters:
wrapped
- the underlying stream which has not reached EOF- Returns:
true
ifwrapped
should be closed,false
if it should be left alone- Throws:
IOException
- in case of an IO problem, for example if the watcher itself closes the underlying stream. The caller will leave the wrapped stream alone, as iffalse
was returned.
-
streamAbort
Description copied from interface:EofSensorWatcher
Indicates that thestream
is aborted. This method will be called only if EOF was not detected before aborting. Otherwise,eofDetected
is called.This method will also be invoked when an input operation causes an IOException to be thrown to make sure the input stream gets shut down.
- Specified by:
streamAbort
in interfaceEofSensorWatcher
- Parameters:
wrapped
- the underlying stream which has not reached EOF- Returns:
true
ifwrapped
should be closed,false
if it should be left alone- Throws:
IOException
- in case of an IO problem, for example if the watcher itself closes the underlying stream. The caller will leave the wrapped stream alone, as iffalse
was returned.
-
toString
-