dk.netarkivet.common.utils.cdx
Class CDXRecord

java.lang.Object
  extended by dk.netarkivet.common.utils.cdx.CDXRecord

public class CDXRecord
extends java.lang.Object

Represents a line i a CDX-file. A CDX-file is an index over arcfiles, with fields for uri, ip, date, mimetype, length, arcfile, and offset in the file.


Constructor Summary
CDXRecord(java.lang.String line)
           
CDXRecord(java.lang.String[] fields)
          Constructor for class CDXRecord.
 
Method Summary
 java.lang.String getArcfile()
          Get the given arcfile
 java.lang.String getDate()
          Get the given date
 java.lang.String getIP()
          Get the given IP
 long getLength()
          Get the given length
 java.lang.String getMimetype()
          Get the given mimetype
 long getOffset()
          Get the given offset
 java.lang.String getURL()
          Get the given URL
static boolean URLsEqual(java.lang.String url1, java.lang.String url2)
          Compare two URLs for equality; first URL-unescaping (in UTF-8) all arguments in any query part.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDXRecord

public CDXRecord(java.lang.String[] fields)
Constructor for class CDXRecord.

Parameters:
fields - the given fields of a line i CDX-format.
Throws:
ArgumentNotValid - if argument is null or number of fields is less than 7 or if length or offset does not contain long values.

CDXRecord

public CDXRecord(java.lang.String line)
Method Detail

URLsEqual

public static boolean URLsEqual(java.lang.String url1,
                                java.lang.String url2)
Compare two URLs for equality; first URL-unescaping (in UTF-8) all arguments in any query part.

Parameters:
url1 - The first URL
url2 - The second URL
Returns:
A boolean indicating whether the URLs are equal

getURL

public java.lang.String getURL()
Get the given URL

Returns:
the URL

getIP

public java.lang.String getIP()
Get the given IP

Returns:
the IP

getDate

public java.lang.String getDate()
Get the given date

Returns:
the date

getMimetype

public java.lang.String getMimetype()
Get the given mimetype

Returns:
The given mimetype

getLength

public long getLength()
Get the given length

Returns:
The given length

getArcfile

public java.lang.String getArcfile()
Get the given arcfile

Returns:
The given arcfile

getOffset

public long getOffset()
Get the given offset

Returns:
The given offset