Class WarcTargetRecord
- Direct Known Subclasses:
WarcCaptureRecord
,WarcContinuation
,WarcConversion
This class exists solely to differentiate between the Warcinfo
record type and all the other standard
record types.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
WarcTargetRecord.Builder<R extends WarcTargetRecord,
B extends WarcTargetRecord.Builder<R, B>> Nested classes/interfaces inherited from class org.netpreserve.jwarc.WarcRecord
WarcRecord.AbstractBuilder<R extends WarcRecord,
B extends WarcRecord.AbstractBuilder<R, B>>, WarcRecord.Constructor<R extends WarcRecord> -
Method Summary
Modifier and TypeMethodDescriptionA content-type that was identified by an independent check (not just what the server said).payload()
Returns the payload of this record if one is present.Digest values that were calculated by applying hash functions to payload.target()
The URI of the original target resource this record holds information about as an unparsed string.The URI of the original target resource this record holds information about.toString()
The ID of aWarcinfo
record associated with this record.Methods inherited from class org.netpreserve.jwarc.WarcRecord
blockDigest, calculatedBlockDigest, date, id, segmentNumber, truncated, type
Methods inherited from class org.netpreserve.jwarc.Message
body, contentType, headers, serializeHeader, version
-
Method Details
-
target
The URI of the original target resource this record holds information about as an unparsed string.Strips enclosing angle brackets if present as a compatibility quirk with WARC 1.0.
-
targetURI
The URI of the original target resource this record holds information about.This method uses URIs.parseLeniently() to percent encode characters that are rejected by the URI class and so may return a value that is not identical to the value of the WARC-Target-URI field. Using
target()
should be preferred unless you actually need an instance of the URI class. -
payloadDigest
Digest values that were calculated by applying hash functions to payload. -
identifiedPayloadType
-
payload
Returns the payload of this record if one is present.This method returns an empty optional when the payload is undefined for this record type or if this library does not know how to parse the body in order to extract the payload. If the payload is well defined but happens to be zero bytes in length this method still returns a WarcPayload object.
- Throws:
IOException
-
warcinfoID
-
toString
- Overrides:
toString
in classWarcRecord
-