public static final class WARCRecord.Header extends Object
WARCRecord
. Each record contains a number of headers
in key-value format, where some header keys are standardised, but nonstandard ones can be
added.
The documentation of the methods in this class is excerpted from the
WARC 1.0
specification. Please see the specification for more detail.Modifier | Constructor and Description |
---|---|
private |
Header(Map<String,String> fields) |
Modifier and Type | Method and Description |
---|---|
int |
getContentLength()
The number of bytes in the body of the record, similar to RFC2616.
|
String |
getContentType()
The MIME type (RFC2045) of the information contained in the record's block.
|
String |
getDateString()
A 14-digit UTC timestamp formatted according to YYYY-MM-DDThh:mm:ssZ, described in the W3C
profile of ISO8601.
|
String |
getField(String field)
Returns the value of a selected header field, or null if there is no header with that field
name.
|
String |
getRecordID()
An identifier assigned to the current record that is globally unique for its period of
intended use.
|
String |
getRecordType()
Returns the type of WARC record (the value of the `WARC-Type` header field).
|
String |
getTargetURI()
The original URI whose capture gave rise to the information content in this record.
|
String |
toString()
Formats this header in WARC/1.0 format, consisting of a version line followed by
colon-delimited key-value pairs, and `\r\n` line endings.
|
void |
write(DataOutput out)
Appends this header to a
DataOutput stream, in WARC/1.0 format. |
public String getRecordType()
public String getDateString()
public String getRecordID()
public String getContentType()
public String getTargetURI()
public int getContentLength()
public String getField(String field)
field
- The name of the header to return (case-sensitive).public void write(DataOutput out) throws IOException
DataOutput
stream, in WARC/1.0 format.out
- The data output to which the header should be written.IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.