Class WarcParser
java.lang.Object
org.netpreserve.jwarc.MessageParser
org.netpreserve.jwarc.WarcParser
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionheaders()booleanisError()booleanstatic WarcParservoidparse(ByteBuffer data) booleanparse(ReadableByteChannel channel, ByteBuffer buffer) longposition()voidreset()voidsetLenient(boolean lenient) Sets the lenient mode for the WarcParser.version()Methods inherited from class org.netpreserve.jwarc.MessageParser
emitWarning, getErrorContext, getErrorContext
-
Constructor Details
-
WarcParser
public WarcParser()
-
-
Method Details
-
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"
-
isFinished
public boolean isFinished() -
isError
public boolean isError() -
parse
-
parse
- Throws:
IOException
-
headers
-
version
-
position
public long position()
-