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.


Constructor Summary
ChecksumEntry(java.lang.String filename, java.lang.String checksum)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          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.
 int hashCode()
          Retrieval of the hashCode of this instance.
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, notify, notifyAll, wait, wait, wait
 

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.

getChecksum

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

Returns:
The checksum.

hashCode

public int hashCode()
Retrieval of the hashCode of this instance.

Overrides:
hashCode in class java.lang.Object
Returns:
The hashCode of this instance.

equals

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

Overrides:
equals in class java.lang.Object
Parameters:
obj - 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.

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.