public abstract class WarcTargetRecord extends WarcRecord
This class exists solely to differentiate between the Warcinfo record type and all the other standard
record types.
| Modifier and Type | Class and Description |
|---|---|
static class |
WarcTargetRecord.Builder<R extends WarcTargetRecord,B extends WarcTargetRecord.Builder<R,B>> |
WarcRecord.AbstractBuilder<R extends WarcRecord,B extends WarcRecord.AbstractBuilder<R,B>>, WarcRecord.Constructor<R extends WarcRecord>| Modifier and Type | Method and Description |
|---|---|
Optional<MediaType> |
identifiedPayloadType()
A content-type that was identified by an independent check (not just what the server said).
|
Optional<WarcPayload> |
payload()
Returns the payload of this record if one is present.
|
Optional<WarcDigest> |
payloadDigest()
Digest values that were calculated by applying hash functions to payload.
|
String |
target()
The URI of the original target resource this record holds information about as an unparsed string.
|
URI |
targetURI()
The URI of the original target resource this record holds information about.
|
String |
toString() |
Optional<URI> |
warcinfoID()
The ID of a
Warcinfo record associated with this record. |
blockDigest, calculatedBlockDigest, date, id, segmentNumber, truncated, typebody, contentType, headers, serializeHeader, versionpublic String target()
Strips enclosing angle brackets if present as a compatibility quirk with WARC 1.0.
public URI targetURI()
public Optional<WarcDigest> payloadDigest()
public Optional<MediaType> identifiedPayloadType()
public Optional<WarcPayload> payload() throws IOException
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.
IOExceptionpublic Optional<URI> warcinfoID()
Warcinfo record associated with this record.public String toString()
toString in class WarcRecordCopyright © 2022. All rights reserved.