Class SizeLimitedResponseReader


  • class SizeLimitedResponseReader
    extends java.lang.Object
    Since:
    4.1
    • Field Detail

      • maxResponseSizeBytes

        private final long maxResponseSizeBytes
      • request

        private final org.apache.http.HttpRequest request
      • inStream

        private java.io.InputStream inStream
      • consumed

        private boolean consumed
    • Constructor Detail

      • SizeLimitedResponseReader

        public SizeLimitedResponseReader​(ResourceFactory resourceFactory,
                                         long maxResponseSizeBytes,
                                         org.apache.http.HttpRequest request,
                                         CloseableHttpResponse response)
        Create an HttpResponse that is limited in size, this allows for checking the size of objects that will be stored in the cache.
    • Method Detail

      • readResponse

        protected void readResponse()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • ensureNotConsumed

        private void ensureNotConsumed()
      • ensureConsumed

        private void ensureConsumed()
      • doConsume

        private void doConsume()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • isLimitReached

        boolean isLimitReached()
      • getReconstructedResponse

        CloseableHttpResponse getReconstructedResponse()
                                                throws java.io.IOException
        Throws:
        java.io.IOException