public class Verifier
extends java.lang.Object
| Constructor and Description |
|---|
Verifier() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkAllFilesInPayloadDirAreListedInAManifest(java.util.Set<java.io.File> filesListedInManifests,
java.io.File rootDir,
boolean ignoreHiddenFiles) |
protected static void |
checkAllFilesListedInManifestExist(java.util.Set<java.io.File> files) |
protected static void |
checkBagitFileExists(java.io.File rootDir) |
protected static void |
checkHashes(Manifest manifest) |
protected static void |
checkIfAtLeastOnePayloadManifestsExist(java.io.File rootDir) |
protected static void |
checkPayloadDirectoryExists(java.io.File rootDir) |
protected static java.util.Set<java.io.File> |
getAllFilesListedInManifests(Bag bag) |
static void |
isComplete(Bag bag,
boolean ignoreHiddenFiles)
See https://tools.ietf.org/html/draft-kunze-bagit-13#section-3
A bag is complete if every element is present every file in the payload manifest(s) are present every file in the tag manifest(s) are present. |
static void |
isValid(Bag bag,
boolean ignoreHiddenFiles)
See https://tools.ietf.org/html/draft-kunze-bagit-13#section-3
A bag is valid if the bag is complete and every checksum has been verified against the contents of its corresponding file. |
public static void isValid(Bag bag, boolean ignoreHiddenFiles) throws java.lang.Exception
java.io.IOExceptionjava.security.NoSuchAlgorithmExceptionFileNotInPayloadDirectoryExceptionMissingPayloadDirectoryExceptionMissingBagitFileExceptionMissingPayloadManifestExceptionCorruptChecksumExceptionjava.lang.InterruptedExceptionjava.lang.Exceptionprotected static void checkHashes(Manifest manifest) throws java.lang.Exception
CorruptChecksumException - if any of the files computed checksum is different than the manifest supplied checksumjava.lang.Exceptionpublic static void isComplete(Bag bag, boolean ignoreHiddenFiles) throws java.io.IOException, MissingPayloadManifestException, MissingBagitFileException, MissingPayloadDirectoryException, FileNotInPayloadDirectoryException, java.lang.InterruptedException
java.io.IOException - if there was an error with the fileMissingPayloadManifestException - if there is not at least one payload manifestMissingBagitFileException - if there is no bagit.txt fileMissingPayloadDirectoryException - if there is no /data directoryFileNotInPayloadDirectoryException - if a manifest lists a file but it is not in the payload directoryjava.lang.InterruptedExceptionprotected static void checkBagitFileExists(java.io.File rootDir)
throws MissingBagitFileException
MissingBagitFileExceptionprotected static void checkPayloadDirectoryExists(java.io.File rootDir)
throws MissingPayloadDirectoryException
MissingPayloadDirectoryExceptionprotected static void checkIfAtLeastOnePayloadManifestsExist(java.io.File rootDir)
throws MissingPayloadManifestException
MissingPayloadManifestExceptionprotected static java.util.Set<java.io.File> getAllFilesListedInManifests(Bag bag) throws java.io.IOException
java.io.IOExceptionprotected static void checkAllFilesListedInManifestExist(java.util.Set<java.io.File> files)
throws FileNotInPayloadDirectoryException,
java.lang.InterruptedException
FileNotInPayloadDirectoryExceptionjava.lang.InterruptedExceptionprotected static void checkAllFilesInPayloadDirAreListedInAManifest(java.util.Set<java.io.File> filesListedInManifests,
java.io.File rootDir,
boolean ignoreHiddenFiles)
throws java.io.IOException
java.io.IOException