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 Details

  • Constructor Details

    • ResponseEntityProxy

      ResponseEntityProxy(org.apache.http.HttpEntity entity, ConnectionHolder connHolder)
  • Method Details

    • enchance

      public static void enchance(org.apache.http.HttpResponse response, ConnectionHolder connHolder)
    • cleanup

      private void cleanup() throws IOException
      Throws:
      IOException
    • abortConnection

      private void abortConnection()
    • releaseConnection

      public void releaseConnection()
    • isRepeatable

      public boolean isRepeatable()
      Specified by:
      isRepeatable in interface org.apache.http.HttpEntity
      Overrides:
      isRepeatable in class org.apache.http.entity.HttpEntityWrapper
    • getContent

      public InputStream getContent() throws IOException
      Specified by:
      getContent in interface org.apache.http.HttpEntity
      Overrides:
      getContent in class org.apache.http.entity.HttpEntityWrapper
      Throws:
      IOException
    • consumeContent

      public void consumeContent() throws IOException
      Specified by:
      consumeContent in interface org.apache.http.HttpEntity
      Overrides:
      consumeContent in class org.apache.http.entity.HttpEntityWrapper
      Throws:
      IOException
    • writeTo

      public void writeTo(OutputStream outStream) throws IOException
      Specified by:
      writeTo in interface org.apache.http.HttpEntity
      Overrides:
      writeTo in class org.apache.http.entity.HttpEntityWrapper
      Throws:
      IOException
    • eofDetected

      public boolean eofDetected(InputStream wrapped) throws IOException
      Description copied from interface: EofSensorWatcher
      Indicates that EOF is detected.
      Specified by:
      eofDetected in interface EofSensorWatcher
      Parameters:
      wrapped - the underlying stream which has reached EOF
      Returns:
      true if wrapped 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 if false was returned.
    • streamClosed

      public boolean streamClosed(InputStream wrapped) throws IOException
      Description copied from interface: EofSensorWatcher
      Indicates that the stream is closed. This method will be called only if EOF was not detected before closing. Otherwise, eofDetected is called.
      Specified by:
      streamClosed in interface EofSensorWatcher
      Parameters:
      wrapped - the underlying stream which has not reached EOF
      Returns:
      true if wrapped 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 if false was returned.
    • streamAbort

      public boolean streamAbort(InputStream wrapped) throws IOException
      Description copied from interface: EofSensorWatcher
      Indicates that the 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.

      Specified by:
      streamAbort in interface EofSensorWatcher
      Parameters:
      wrapped - the underlying stream which has not reached EOF
      Returns:
      true if wrapped 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 if false was returned.
    • toString

      public String toString()
      Overrides:
      toString in class Object