Class FixityTests


public class FixityTests extends MessageDigestValue
Perform Fixity tests
Author:
dloy
  • Field Details

  • Constructor Details

    • FixityTests

      public FixityTests(File file, String checksumType, LoggerInf inLogger) throws TException
      Constructur - primary form Performs checksum creation on file and extacts file size
      Parameters:
      file - file used for fixity data creation
      checksumType -
      inLogger -
      Throws:
      TException
    • FixityTests

      public FixityTests(InputStream ioStream, String checksumType, LoggerInf inLogger) throws TException
      Constructer - primary form Performs checksum creation on file and extacts file size
      Parameters:
      ioStream - Input Stream from digital object for fixity
      checksumType -
      inLogger -
      Throws:
      TException
  • Method Details

    • testLog

      protected LoggerInf testLog(LoggerInf logger) throws TException
      Throw exception if log is null
      Parameters:
      logger - logger to check
      Returns:
      logger if non-null
      Throws:
      TException - null log
    • dumpEntry

      protected String dumpEntry(String key, String value)
      format entry for log
      Overrides:
      dumpEntry in class MessageDigestValue
      Parameters:
      key - format key
      value - format value
      Returns:
      formated key=value
    • addProp

      protected void addProp(Properties prop, String key, String value)
      Add property if non-null
      Parameters:
      prop - Properties to contain key-value
      key - property key
      value - property
    • validateSizeChecksum

      public FixityTests.FixityResult validateSizeChecksum(String passedChecksum, String passedChecksumTypeS, long passedFileSize) throws TException
      Get the download size and checksum for this file
      Throws:
      TException