Class DefaultHttpResponseParser

  • All Implemented Interfaces:
    org.apache.http.io.HttpMessageParser<org.apache.http.HttpResponse>

    public class DefaultHttpResponseParser
    extends org.apache.http.impl.io.AbstractMessageParser<org.apache.http.HttpResponse>
    Lenient HTTP response parser implementation that can skip malformed data until a valid HTTP response message head is encountered.
    Since:
    4.2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.http.util.CharArrayBuffer lineBuf  
      private org.apache.commons.logging.Log log  
      private org.apache.http.HttpResponseFactory responseFactory  
      • Fields inherited from class org.apache.http.impl.io.AbstractMessageParser

        lineParser
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.apache.http.HttpResponse parseHead​(org.apache.http.io.SessionInputBuffer sessionBuffer)  
      protected boolean reject​(org.apache.http.util.CharArrayBuffer line, int count)  
      • Methods inherited from class org.apache.http.impl.io.AbstractMessageParser

        parse, parseHeaders, parseHeaders
      • Methods inherited from class java.lang.Object

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

      • log

        private final org.apache.commons.logging.Log log
      • responseFactory

        private final org.apache.http.HttpResponseFactory responseFactory
      • lineBuf

        private final org.apache.http.util.CharArrayBuffer lineBuf
    • Constructor Detail

      • DefaultHttpResponseParser

        public DefaultHttpResponseParser​(org.apache.http.io.SessionInputBuffer buffer,
                                         org.apache.http.message.LineParser lineParser,
                                         org.apache.http.HttpResponseFactory responseFactory,
                                         org.apache.http.config.MessageConstraints constraints)
        Creates new instance of DefaultHttpResponseParser.
        Parameters:
        buffer - the session input buffer.
        lineParser - the line parser. If null BasicLineParser.INSTANCE will be used.
        responseFactory - HTTP response factory. If null DefaultHttpResponseFactory.INSTANCE will be used.
        constraints - the message constraints. If null MessageConstraints.DEFAULT will be used.
        Since:
        4.3
      • DefaultHttpResponseParser

        public DefaultHttpResponseParser​(org.apache.http.io.SessionInputBuffer buffer,
                                         org.apache.http.config.MessageConstraints constraints)
        Creates new instance of DefaultHttpResponseParser.
        Parameters:
        buffer - the session input buffer.
        constraints - the message constraints. If null MessageConstraints.DEFAULT will be used.
        Since:
        4.3
      • DefaultHttpResponseParser

        public DefaultHttpResponseParser​(org.apache.http.io.SessionInputBuffer buffer)
        Creates new instance of DefaultHttpResponseParser.
        Parameters:
        buffer - the session input buffer.
        Since:
        4.3
    • Method Detail

      • parseHead

        protected org.apache.http.HttpResponse parseHead​(org.apache.http.io.SessionInputBuffer sessionBuffer)
                                                  throws java.io.IOException,
                                                         org.apache.http.HttpException
        Specified by:
        parseHead in class org.apache.http.impl.io.AbstractMessageParser<org.apache.http.HttpResponse>
        Throws:
        java.io.IOException
        org.apache.http.HttpException
      • reject

        protected boolean reject​(org.apache.http.util.CharArrayBuffer line,
                                 int count)