Class MonitoredHttpResponseContentInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    final class MonitoredHttpResponseContentInputStream
    extends MonitorInputStream
    An InputStream that cleans up the org.apache.http.client.methods.CloseableHttpResponse on close.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.http.HttpResponse httpResponse  
      • Fields inherited from class java.io.BufferedInputStream

        buf, count, marklimit, markpos, pos
      • Fields inherited from class java.io.FilterInputStream

        in
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void closeSuper()
      Prevent closing the stream itself if the httpResponse is closeable.
      protected void onClose()
      Called after the stream has been closed.
      • Methods inherited from class java.io.BufferedInputStream

        mark, markSupported, reset, skip
      • Methods inherited from class java.io.FilterInputStream

        read
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • httpResponse

        private final org.apache.http.HttpResponse httpResponse
    • Constructor Detail

      • MonitoredHttpResponseContentInputStream

        public MonitoredHttpResponseContentInputStream​(org.apache.http.HttpResponse httpResponse)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • MonitoredHttpResponseContentInputStream

        public MonitoredHttpResponseContentInputStream​(org.apache.http.HttpResponse httpResponse,
                                                       int bufferSize)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • closeSuper

        protected void closeSuper()
                           throws java.io.IOException
        Prevent closing the stream itself if the httpResponse is closeable. Closing the stream may consume all remaining data no matter how large (VFS-805).
        Overrides:
        closeSuper in class MonitorInputStream
        Throws:
        java.io.IOException - if an IO error occurs.
      • onClose

        protected void onClose()
                        throws java.io.IOException
        Description copied from class: MonitorInputStream
        Called after the stream has been closed. This implementation does nothing.
        Overrides:
        onClose in class MonitorInputStream
        Throws:
        java.io.IOException - if an error occurs.