Class WarcCapture
java.lang.Object
org.netpreserve.jwarc.WarcCapture
Represents a capture event in a WARC file, which consists of one or more sequential WARC records linked by
WARC-Concurrent-To headers.
EXPERIMENTAL API: May change or be removed without notice.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the content type of the payload, if available.date()metadata()Returns the first metadata record associated with the current capture event, if present.method()Returns the HTTP request method, if available.record()Returns the main WARC capture record for the current capture event.records()Returns the list of all WARC records associated with this capture event.request()Returns the first request record associated with the current capture event, if present.status()Returns the HTTP response status code, if available.target()warcinfo()Returns the warcinfo record associated with the current capture event, if present.
-
Method Details
-
target
-
targetURI
-
date
-
method
-
status
-
contentType
-
record
Returns the main WARC capture record for the current capture event. This will typically be the resource, response or revisit record. If none of these are present, returns the first record in the capture event.- Throws:
IOException
-
records
Returns the list of all WARC records associated with this capture event.- Throws:
IOException
-
metadata
Returns the first metadata record associated with the current capture event, if present.- Returns:
- an
Optionalcontaining the WARC metadata record if found, otherwise an emptyOptional. - Throws:
IOException- if an error occurs while reading WARC records.
-
request
Returns the first request record associated with the current capture event, if present.- Returns:
- an
Optionalcontaining the WARC request record if found, otherwise an emptyOptional. - Throws:
IOException- if an error occurs while reading WARC records.
-
warcinfo
Returns the warcinfo record associated with the current capture event, if present.- Throws:
IOException
-