Package org.cdlib.mrt.utility
Class FixityTests
java.lang.Object
org.cdlib.mrt.utility.MessageDigestValue
org.cdlib.mrt.utility.FixityTests
Perform Fixity tests
- Author:
- dloy
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.cdlib.mrt.utility.MessageDigestValue
MessageDigestValue.Result
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
protected static final boolean
protected static final String
protected static final String
Fields inherited from class org.cdlib.mrt.utility.MessageDigestValue
checksum, checksumType, inputSize, logger
-
Constructor Summary
ConstructorsConstructorDescriptionFixityTests
(File file, String checksumType, LoggerInf inLogger) Constructur - primary form Performs checksum creation on file and extacts file sizeFixityTests
(InputStream ioStream, String checksumType, LoggerInf inLogger) Constructer - primary form Performs checksum creation on file and extacts file size -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addProp
(Properties prop, String key, String value) Add property if non-nullprotected String
format entry for logprotected LoggerInf
Throw exception if log is nullvalidateSizeChecksum
(String passedChecksum, String passedChecksumTypeS, long passedFileSize) Get the download size and checksum for this fileMethods inherited from class org.cdlib.mrt.utility.MessageDigestValue
dump, getAlgorithm, getChecksum, getChecksumBit64, getChecksumBit64, getCheckSumBit64, getChecksumHex, getChecksumJavaAlgorithm, getChecksumType, getInputSize, getResult, makeTException, setSizeChecksum, setSizeChecksum32, toByteArray, toHexString
-
Field Details
-
NAME
- See Also:
-
MESSAGE
- See Also:
-
BUFSIZE
protected static final int BUFSIZE- See Also:
-
DEBUG
protected static final boolean DEBUG- See Also:
-
-
Constructor Details
-
FixityTests
Constructur - primary form Performs checksum creation on file and extacts file size- Parameters:
file
- file used for fixity data creationchecksumType
-inLogger
-- Throws:
TException
-
FixityTests
Constructer - primary form Performs checksum creation on file and extacts file size- Parameters:
ioStream
- Input Stream from digital object for fixitychecksumType
-inLogger
-- Throws:
TException
-
-
Method Details
-
testLog
Throw exception if log is null- Parameters:
logger
- logger to check- Returns:
- logger if non-null
- Throws:
TException
- null log
-
dumpEntry
format entry for log- Overrides:
dumpEntry
in classMessageDigestValue
- Parameters:
key
- format keyvalue
- format value- Returns:
- formated key=value
-
addProp
Add property if non-null- Parameters:
prop
- Properties to contain key-valuekey
- property keyvalue
- 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
-