dk.netarkivet.common.utils.archive
Class ArchiveHeaderBase

java.lang.Object
  extended by dk.netarkivet.common.utils.archive.ArchiveHeaderBase
Direct Known Subclasses:
HeritrixArchiveHeaderWrapper

public abstract class ArchiveHeaderBase
extends java.lang.Object

Utility class for presenting the same interface record header API for both ARC and WARC record headers.


Field Summary
 boolean bIsArc
          Is this record from an ARC file.
 boolean bIsWarc
          Is this record from a WARC file.
 
Constructor Summary
ArchiveHeaderBase()
           
 
Method Summary
abstract  java.lang.String getArcDateStr()
          Return the header date in the ARC string format for use in CDX output.
abstract  java.io.File getArchiveFile()
          Return the archive File
abstract  java.util.Date getDate()
          Return the header date as a Date object.
abstract  java.util.Set<java.lang.String> getHeaderFieldKeys()
          Return a Set of header keys.
abstract  java.util.Map<java.lang.String,java.lang.Object> getHeaderFields()
          Return a Map of all header key/value pairs.
abstract  java.lang.String getHeaderStringValue(java.lang.String key)
          Return a header value string.
abstract  java.lang.Object getHeaderValue(java.lang.String key)
          Return a header value object.
abstract  java.lang.String getIp()
          Get the IP-Address from the header.
abstract  long getLength()
          Get the record length from the header.
abstract  java.lang.String getMimetype()
          Get the content-type from the header and not the payload.
abstract  long getOffset()
          Get record offset.
abstract  java.lang.String getReaderIdentifier()
          Return the reader identifier.
abstract  java.lang.String getRecordIdentifier()
          Return the record identifier.
abstract  java.lang.String getUrl()
          Get the URL from the header.
abstract  java.lang.String getVersion()
          Get record version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bIsArc

public boolean bIsArc
Is this record from an ARC file.


bIsWarc

public boolean bIsWarc
Is this record from a WARC file.

Constructor Detail

ArchiveHeaderBase

public ArchiveHeaderBase()
Method Detail

getHeaderValue

public abstract java.lang.Object getHeaderValue(java.lang.String key)
Return a header value object.

Parameters:
key - header key
Returns:
header value object

getHeaderStringValue

public abstract java.lang.String getHeaderStringValue(java.lang.String key)
Return a header value string.

Parameters:
key - header key
Returns:
header value string

getHeaderFieldKeys

public abstract java.util.Set<java.lang.String> getHeaderFieldKeys()
Return a Set of header keys.

Returns:
Set of header keys.

getHeaderFields

public abstract java.util.Map<java.lang.String,java.lang.Object> getHeaderFields()
Return a Map of all header key/value pairs.

Returns:
Map of all header key/value pairs.

getDate

public abstract java.util.Date getDate()
Return the header date as a Date object.

Returns:
header date as a Date object

getArcDateStr

public abstract java.lang.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 java.lang.String getUrl()
Get the URL from the header.

Returns:
the URL from the header

getIp

public abstract java.lang.String getIp()
Get the IP-Address from the header.

Returns:
the IP-Address from the header

getMimetype

public abstract java.lang.String getMimetype()
Get the content-type from the header and not the payload.

Returns:
the content-type from the header

getVersion

public abstract java.lang.String getVersion()
Get record version.

Returns:
record version

getOffset

public abstract long getOffset()
Get record offset.

Returns:
record offset

getReaderIdentifier

public abstract java.lang.String getReaderIdentifier()
Return the reader identifier.

Returns:
reader identifier

getRecordIdentifier

public abstract java.lang.String getRecordIdentifier()
Return the record identifier.

Returns:
record identifier

getArchiveFile

public abstract java.io.File getArchiveFile()
Return the archive File
Returns:
archive File