Class ArchiveHeaderBase
- java.lang.Object
-
- dk.netarkivet.common.utils.archive.ArchiveHeaderBase
-
- Direct Known Subclasses:
HeritrixArchiveHeaderWrapper
public abstract class ArchiveHeaderBase extends Object
Utility class for presenting the same interface record header API for both ARC and WARC record headers.
-
-
Constructor Summary
Constructors Constructor Description ArchiveHeaderBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract String
getArcDateStr()
Return the header date in the ARC string format for use in CDX output.abstract File
getArchiveFile()
Return the archiveFile
abstract Date
getDate()
Return the header date as aDate
object.abstract Set<String>
getHeaderFieldKeys()
Return aSet
of header keys.abstract Map<String,Object>
getHeaderFields()
Return aMap
of all header key/value pairs.abstract String
getHeaderStringValue(String key)
Return a header value string.abstract Object
getHeaderValue(String key)
Return a header value object.abstract String
getIp()
Get the IP-Address from the header.abstract long
getLength()
Get the record length from the header.abstract String
getMimetype()
Get the content-type from the header and not the payload.abstract long
getOffset()
Get record offset.abstract String
getReaderIdentifier()
Return the reader identifier.abstract String
getRecordIdentifier()
Return the record identifier.abstract String
getUrl()
Get the URL from the header.abstract String
getVersion()
Get record version.
-
-
-
Method Detail
-
getHeaderValue
public abstract Object getHeaderValue(String key)
Return a header value object.- Parameters:
key
- header key- Returns:
- header value object
-
getHeaderStringValue
public abstract String getHeaderStringValue(String key)
Return a header value string.- Parameters:
key
- header key- Returns:
- header value string
-
getHeaderFieldKeys
public abstract Set<String> getHeaderFieldKeys()
Return aSet
of header keys.- Returns:
Set
of header keys.
-
getHeaderFields
public abstract Map<String,Object> getHeaderFields()
Return aMap
of all header key/value pairs.- Returns:
Map
of all header key/value pairs.
-
getDate
public abstract Date getDate()
Return the header date as aDate
object.- Returns:
- header date as a
Date
object
-
getArcDateStr
public abstract String getArcDateStr()
Return the header date in the ARC string format for use in CDX output.- Returns:
- header date in the ARC string format
-
getLength
public abstract long getLength()
Get the record length from the header.- Returns:
- the record length
-
getUrl
public abstract String getUrl()
Get the URL from the header.- Returns:
- the URL from the header
-
getIp
public abstract String getIp()
Get the IP-Address from the header.- Returns:
- the IP-Address from the header
-
getMimetype
public abstract String getMimetype()
Get the content-type from the header and not the payload.- Returns:
- the content-type from the header
-
getVersion
public abstract String getVersion()
Get record version.- Returns:
- record version
-
getOffset
public abstract long getOffset()
Get record offset.- Returns:
- record offset
-
getReaderIdentifier
public abstract String getReaderIdentifier()
Return the reader identifier.- Returns:
- reader identifier
-
getRecordIdentifier
public abstract String getRecordIdentifier()
Return the record identifier.- Returns:
- record identifier
-
getArchiveFile
public abstract File getArchiveFile()
Return the archiveFile
- Returns:
- archive
File
-
-