class ResponseEntityProxy extends org.apache.http.entity.HttpEntityWrapper implements EofSensorWatcher
HttpEntity
enclosed in a response message.Modifier and Type | Field and Description |
---|---|
private ConnectionHolder |
connHolder |
Constructor and Description |
---|
ResponseEntityProxy(org.apache.http.HttpEntity entity,
ConnectionHolder connHolder) |
Modifier and Type | Method and Description |
---|---|
private void |
abortConnection() |
private void |
cleanup() |
void |
consumeContent() |
static void |
enchance(org.apache.http.HttpResponse response,
ConnectionHolder connHolder) |
boolean |
eofDetected(java.io.InputStream wrapped)
Indicates that EOF is detected.
|
java.io.InputStream |
getContent() |
boolean |
isRepeatable() |
void |
releaseConnection() |
boolean |
streamAbort(java.io.InputStream wrapped)
Indicates that the
stream is aborted. |
boolean |
streamClosed(java.io.InputStream wrapped)
Indicates that the
stream is closed. |
java.lang.String |
toString() |
void |
writeTo(java.io.OutputStream outStream) |
private final ConnectionHolder connHolder
ResponseEntityProxy(org.apache.http.HttpEntity entity, ConnectionHolder connHolder)
public static void enchance(org.apache.http.HttpResponse response, ConnectionHolder connHolder)
private void cleanup() throws java.io.IOException
java.io.IOException
private void abortConnection()
public void releaseConnection()
public boolean isRepeatable()
isRepeatable
in interface org.apache.http.HttpEntity
isRepeatable
in class org.apache.http.entity.HttpEntityWrapper
public java.io.InputStream getContent() throws java.io.IOException
getContent
in interface org.apache.http.HttpEntity
getContent
in class org.apache.http.entity.HttpEntityWrapper
java.io.IOException
public void consumeContent() throws java.io.IOException
consumeContent
in interface org.apache.http.HttpEntity
consumeContent
in class org.apache.http.entity.HttpEntityWrapper
java.io.IOException
public void writeTo(java.io.OutputStream outStream) throws java.io.IOException
writeTo
in interface org.apache.http.HttpEntity
writeTo
in class org.apache.http.entity.HttpEntityWrapper
java.io.IOException
public boolean eofDetected(java.io.InputStream wrapped) throws java.io.IOException
EofSensorWatcher
eofDetected
in interface EofSensorWatcher
wrapped
- the underlying stream which has reached EOFtrue
if wrapped
should be closed,
false
if it should be left alonejava.io.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 if false
was returned.public boolean streamClosed(java.io.InputStream wrapped) throws java.io.IOException
EofSensorWatcher
stream
is closed.
This method will be called only if EOF was not detected
before closing. Otherwise, eofDetected
is called.streamClosed
in interface EofSensorWatcher
wrapped
- the underlying stream which has not reached EOFtrue
if wrapped
should be closed,
false
if it should be left alonejava.io.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 if false
was returned.public boolean streamAbort(java.io.InputStream wrapped) throws java.io.IOException
EofSensorWatcher
stream
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.
streamAbort
in interface EofSensorWatcher
wrapped
- the underlying stream which has not reached EOFtrue
if wrapped
should be closed,
false
if it should be left alonejava.io.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 if false
was returned.public java.lang.String toString()
toString
in class java.lang.Object