dk.netarkivet.archive.arcrepository.bitpreservation
Class ChecksumEntry

java.lang.Object
  extended by dk.netarkivet.archive.arcrepository.bitpreservation.ChecksumEntry

public class ChecksumEntry
extends java.lang.Object

Method for storing a checksum along with its filename. This class also holds the method for extracting the results of a ChecksumJob into a list of ChecksumEntry, which is used by the BitPreservationDAO.


Field Summary
 java.lang.String checksum
          The checksum of the file.
 java.lang.String filename
          The name of the file for which the checksum belongs.
 
Constructor Summary
ChecksumEntry(java.lang.String filename, java.lang.String checksum)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
          Method for testing whether a ChecksumEntry is identical to another ChecksumEntry.
 java.lang.String getChecksum()
          Retrieves the checksum.
 java.lang.String getFilename()
          Retrieves the filename.
static java.util.List<ChecksumEntry> parseChecksumJob(java.io.File checksumjobOutput)
          Method for changing the resulting file of a checksum job into a list of ChecksumEntry.
 java.lang.String toString()
          Make human readable string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

filename

public java.lang.String filename
The name of the file for which the checksum belongs.


checksum

public java.lang.String checksum
The checksum of the file.

Constructor Detail

ChecksumEntry

public ChecksumEntry(java.lang.String filename,
                     java.lang.String checksum)
Constructor.

Parameters:
filename - The name of the file.
checksum - The checksum of the file.
Method Detail

getFilename

public java.lang.String getFilename()
Retrieves the filename.

Returns:
The filename.

equals

public boolean equals(java.lang.Object o)
Method for testing whether a ChecksumEntry is identical to another ChecksumEntry.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to evaluate whether it is identical to this ChecksumEntry.
Returns:
Whether the argument has the same values as this ChecksumEntry. It returns false if the argument is not of type ChecksumEntry, or if it has either different filename or different checksum.

getChecksum

public java.lang.String getChecksum()
Retrieves the checksum.

Returns:
The checksum.

toString

public java.lang.String toString()
Make human readable string.

Overrides:
toString in class java.lang.Object
Returns:
This instance as a human readable string.

parseChecksumJob

public static java.util.List<ChecksumEntry> parseChecksumJob(java.io.File checksumjobOutput)
Method for changing the resulting file of a checksum job into a list of ChecksumEntry.

Parameters:
checksumjobOutput - The file with the ouput from a checksum job.
Returns:
The list of the checksum entries.