AbstractWarcRecord
, HttpRequestWarcRecord
, HttpResponseWarcRecord
, InfoWarcRecord
public interface WarcRecord
Required factory method:
a concrete type T
implementing this interface must provide a factory method with signature
public static T fromPayload(final HeaderGroup warcHeaders, final BoundSessionInputBuffer payloadBuffer) throws IOException;and update the
WarcRecord.Type
enum.Modifier and Type | Interface | Description |
---|---|---|
static class |
WarcRecord.Type |
An enumeration of implemented record types.
|
Modifier and Type | Field | Description |
---|---|---|
static org.apache.http.ProtocolVersion |
PROTOCOL_VERSION |
The version of the supported format.
|
Modifier and Type | Method | Description |
---|---|---|
long |
getWarcContentLength() |
Returns the WARC
Content-Length header. |
java.util.Date |
getWarcDate() |
Returns the
WARC-Date header. |
org.apache.http.Header |
getWarcHeader(WarcHeader.Name header) |
Returns the specified WARC header.
|
org.apache.http.message.HeaderGroup |
getWarcHeaders() |
Returns the WARC headers.
|
java.util.UUID |
getWarcRecordId() |
Returns the
WARC-Record-ID header. |
java.net.URI |
getWarcTargetURI() |
Returns the
WARC-Target-URI header as a URI . |
WarcRecord.Type |
getWarcType() |
Returns the
WARC-Type header. |
void |
write(java.io.OutputStream output,
ByteArraySessionOutputBuffer buffer) |
Writes the WARC record.
|
static final org.apache.http.ProtocolVersion PROTOCOL_VERSION
void write(java.io.OutputStream output, ByteArraySessionOutputBuffer buffer) throws java.io.IOException
output
- the stream where to write the record.buffer
- a buffer that will be optionally used by the writer.java.io.IOException
org.apache.http.message.HeaderGroup getWarcHeaders()
org.apache.http.Header getWarcHeader(WarcHeader.Name header)
header
- the name of the header to return.null
if the header is not present.java.util.UUID getWarcRecordId()
WARC-Record-ID
header.java.lang.IllegalStateException
- in case the header (which is mandatory) is not present.WarcRecord.Type getWarcType()
WARC-Type
header.java.lang.IllegalStateException
- in case the header (which is mandatory) is not present.java.util.Date getWarcDate()
WARC-Date
header.java.lang.IllegalStateException
- in case the header (which is mandatory) is not present.long getWarcContentLength()
Content-Length
header.java.lang.IllegalStateException
- in case the header (which is mandatory) is not present.java.net.URI getWarcTargetURI()
WARC-Target-URI
header as a URI
.
Note that different implementations might be more or less strict with respect to parsing.
See, for instance, AbstractWarcRecord.getWarcTargetURI()
.
java.lang.IllegalStateException
- if the header is not present.java.lang.IllegalArgumentException
- if the header value cannot be parsed into a URI.AbstractWarcRecord.getWarcTargetURI()