Class HeritrixArchiveHeaderWrapper
- java.lang.Object
-
- dk.netarkivet.common.utils.archive.ArchiveHeaderBase
-
- dk.netarkivet.common.utils.archive.HeritrixArchiveHeaderWrapper
-
public class HeritrixArchiveHeaderWrapper extends ArchiveHeaderBase
Heritrix wrapper implementation of the abstract archive header interface.
-
-
Field Summary
Fields Modifier and Type Field Description protected DateFormat
arcDateFormat
Reuse the same ARCDateFormat
object.protected org.archive.io.ArchiveRecordHeader
header
Original Heritrix header object.protected Map<String,Object>
headerFields
Map of header fields extracted from the Heritrix header.protected HeritrixArchiveRecordWrapper
recordWrapper
Wrapper Heritrix header.protected DateFormat
warcDateFormat
Reuse the sme WARCDateFormat
object.-
Fields inherited from class dk.netarkivet.common.utils.archive.ArchiveHeaderBase
bIsArc, bIsWarc
-
-
Constructor Summary
Constructors Constructor Description HeritrixArchiveHeaderWrapper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getArcDateStr()
Return the header date in the ARC string format for use in CDX output.File
getArchiveFile()
Return the archiveFile
Date
getDate()
Return the header date as aDate
object.Set<String>
getHeaderFieldKeys()
Return aSet
of header keys.Map<String,Object>
getHeaderFields()
Return aMap
of all header key/value pairs.String
getHeaderStringValue(String key)
Return a header value string.Object
getHeaderValue(String key)
Return a header value object.String
getIp()
Get the IP-Address from the header.long
getLength()
Get the record length from the header.String
getMimetype()
Get the content-type from the header and not the payload.long
getOffset()
Get record offset.String
getReaderIdentifier()
Return the reader identifier.String
getRecordIdentifier()
Return the record identifier.String
getUrl()
Get the URL from the header.String
getVersion()
Get record version.static HeritrixArchiveHeaderWrapper
wrapArchiveHeader(HeritrixArchiveRecordWrapper recordWrapper, org.archive.io.ArchiveRecord record)
Construct a Heritrix record header wrapper object.
-
-
-
Field Detail
-
warcDateFormat
protected DateFormat warcDateFormat
Reuse the sme WARCDateFormat
object.
-
arcDateFormat
protected DateFormat arcDateFormat
Reuse the same ARCDateFormat
object.
-
recordWrapper
protected HeritrixArchiveRecordWrapper recordWrapper
Wrapper Heritrix header.
-
header
protected org.archive.io.ArchiveRecordHeader header
Original Heritrix header object.
-
-
Method Detail
-
wrapArchiveHeader
public static HeritrixArchiveHeaderWrapper wrapArchiveHeader(HeritrixArchiveRecordWrapper recordWrapper, org.archive.io.ArchiveRecord record)
Construct a Heritrix record header wrapper object.- Parameters:
recordWrapper
- wrapped Heritrix headerrecord
- original Heritrix record- Returns:
- wrapped Heritrix record header
-
getHeaderValue
public Object getHeaderValue(String key)
Description copied from class:ArchiveHeaderBase
Return a header value object.- Specified by:
getHeaderValue
in classArchiveHeaderBase
- Parameters:
key
- header key- Returns:
- header value object
-
getHeaderStringValue
public String getHeaderStringValue(String key)
Description copied from class:ArchiveHeaderBase
Return a header value string.- Specified by:
getHeaderStringValue
in classArchiveHeaderBase
- Parameters:
key
- header key- Returns:
- header value string
-
getHeaderFieldKeys
public Set<String> getHeaderFieldKeys()
Description copied from class:ArchiveHeaderBase
Return aSet
of header keys.- Specified by:
getHeaderFieldKeys
in classArchiveHeaderBase
- Returns:
Set
of header keys.
-
getHeaderFields
public Map<String,Object> getHeaderFields()
Description copied from class:ArchiveHeaderBase
Return aMap
of all header key/value pairs.- Specified by:
getHeaderFields
in classArchiveHeaderBase
- Returns:
Map
of all header key/value pairs.
-
getVersion
public String getVersion()
Description copied from class:ArchiveHeaderBase
Get record version.- Specified by:
getVersion
in classArchiveHeaderBase
- Returns:
- record version
-
getReaderIdentifier
public String getReaderIdentifier()
Description copied from class:ArchiveHeaderBase
Return the reader identifier.- Specified by:
getReaderIdentifier
in classArchiveHeaderBase
- Returns:
- reader identifier
-
getRecordIdentifier
public String getRecordIdentifier()
Description copied from class:ArchiveHeaderBase
Return the record identifier.- Specified by:
getRecordIdentifier
in classArchiveHeaderBase
- Returns:
- record identifier
-
getUrl
public String getUrl()
Description copied from class:ArchiveHeaderBase
Get the URL from the header.- Specified by:
getUrl
in classArchiveHeaderBase
- Returns:
- the URL from the header
-
getIp
public String getIp()
Description copied from class:ArchiveHeaderBase
Get the IP-Address from the header.- Specified by:
getIp
in classArchiveHeaderBase
- Returns:
- the IP-Address from the header
-
getOffset
public long getOffset()
Description copied from class:ArchiveHeaderBase
Get record offset.- Specified by:
getOffset
in classArchiveHeaderBase
- Returns:
- record offset
-
getLength
public long getLength()
Description copied from class:ArchiveHeaderBase
Get the record length from the header.- Specified by:
getLength
in classArchiveHeaderBase
- Returns:
- the record length
-
getDate
public Date getDate()
Description copied from class:ArchiveHeaderBase
Return the header date as aDate
object.- Specified by:
getDate
in classArchiveHeaderBase
- Returns:
- header date as a
Date
object
-
getArcDateStr
public String getArcDateStr()
Description copied from class:ArchiveHeaderBase
Return the header date in the ARC string format for use in CDX output.- Specified by:
getArcDateStr
in classArchiveHeaderBase
- Returns:
- header date in the ARC string format
-
getMimetype
public String getMimetype()
Description copied from class:ArchiveHeaderBase
Get the content-type from the header and not the payload.- Specified by:
getMimetype
in classArchiveHeaderBase
- Returns:
- the content-type from the header
-
getArchiveFile
public File getArchiveFile()
Description copied from class:ArchiveHeaderBase
Return the archiveFile
- Specified by:
getArchiveFile
in classArchiveHeaderBase
- Returns:
- archive
File
-
-