Class HttpParser

java.lang.Object
org.netpreserve.jwarc.MessageParser
org.netpreserve.jwarc.HttpParser

public class HttpParser extends MessageParser
  • Constructor Details

    • HttpParser

      public HttpParser()
  • Method Details

    • reset

      public void reset()
    • headers

      public MessageHeaders headers()
    • version

      public MessageVersion version()
    • status

      public int status()
    • reason

      public String reason()
    • target

      public String target()
    • method

      public String method()
    • isFinished

      public boolean isFinished()
    • isError

      public boolean isError()
    • strictRequest

      public void strictRequest()
      Configures the parser to read a HTTP request while rejecting deviations from the standard.
    • strictResponse

      public void strictResponse()
      Configures the parser to read a HTTP response while rejecting deviations from the standard.
    • lenientRequest

      public void lenientRequest()
      Configures the parser to read a HTTP request while allowing some deviations from the standard:
      • The number of spaces in the request line may vary
      • Any character except space and newline is allowed in the target
      • Lines may end with LF instead of CRLF
      • Any byte except LF is allowed in header field values
      • Whitespace is allowed between the field name and colon
    • lenientResponse

      public void lenientResponse()
      Configures the parser to read a HTTP response while allowing some deviations from the standard:
      • The number of spaces in the status line may vary
      • Lines may end with LF instead of CRLF
      • Any byte except LF is allowed in header field values
      • Whitespace is allowed between the field name and colon
    • parse

      public void parse(ByteBuffer data)
      Runs the parser on a buffer of data. Passing null as the buffer indicates the end of input.
    • parse

      public void parse(ReadableByteChannel channel, ByteBuffer buffer) throws IOException
      Throws:
      IOException