Class WarcParser

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

public class WarcParser extends MessageParser
Low-level WARC record parser.

Unless you're doing something advanced (like non-blocking IO) you should use the higher-level WarcReader class instead.

  • Constructor Details

    • WarcParser

      public WarcParser()
  • Method Details

    • newWarcFieldsParser

      public static WarcParser newWarcFieldsParser()
    • reset

      public void reset()
    • setLenient

      public void setLenient(boolean lenient)
      Sets the lenient mode for the WarcParser.

      When enabled, this causes the parser to follow the specification less strictly, allowing reading of non-compliant records by:

      • permitting ASCII control characters in header field names and values
      • allowing lines to end with LF instead of CRLF
      • permitting multi-digit WARC minor versions like "0.18"
      Calling this method also resets the state of the parser.
    • isFinished

      public boolean isFinished()
    • isError

      public boolean isError()
    • parse

      public void parse(ByteBuffer data)
    • parse

      public boolean parse(ReadableByteChannel channel, ByteBuffer buffer) throws IOException
      Throws:
      IOException
    • headers

      public MessageHeaders headers()
    • version

      public MessageVersion version()
    • position

      public long position()