Package nl.knaw.dans.bagit.verify
Class MandatoryVerifier
java.lang.Object
nl.knaw.dans.bagit.verify.MandatoryVerifier
Responsible for checking all things related to mandatory files for the bagit specification
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
private static final org.slf4j.Logger
private static final ResourceBundle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkBagitFileExists
(Path rootDir, Version version) make sure the bagit.txt file existsstatic void
checkFetchItemsExist
(List<FetchItem> items, Path bagDir) make sure all the fetch items exist in the data directorystatic void
checkIfAtLeastOnePayloadManifestsExist
(Path rootDir, Version version) Check to make sure the bag has at least one payload manifest (manifest-[ALGORITHM].txt)static void
Make sure the payload directory exists
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
messages
-
DOT_BAGIT_DIR_NAME
- See Also:
-
-
Constructor Details
-
MandatoryVerifier
private MandatoryVerifier()
-
-
Method Details
-
checkFetchItemsExist
public static void checkFetchItemsExist(List<FetchItem> items, Path bagDir) throws FileNotInPayloadDirectoryException make sure all the fetch items exist in the data directory- Parameters:
items
- the items that needed to be fetched for the bag to be completebagDir
- the root directory of the bag- Throws:
FileNotInPayloadDirectoryException
- if one or more of the fetch items don't exist
-
checkBagitFileExists
public static void checkBagitFileExists(Path rootDir, Version version) throws MissingBagitFileException make sure the bagit.txt file exists- Parameters:
rootDir
- the root directory of the bagversion
- the version of the bag- Throws:
MissingBagitFileException
- if the bag does not contain the bagit.txt file as required by the bagit specification
-
checkPayloadDirectoryExists
Make sure the payload directory exists- Parameters:
bag
- the bag to check- Throws:
MissingPayloadDirectoryException
- if the bag does not contain the payload directory
-
checkIfAtLeastOnePayloadManifestsExist
public static void checkIfAtLeastOnePayloadManifestsExist(Path rootDir, Version version) throws MissingPayloadManifestException, IOException Check to make sure the bag has at least one payload manifest (manifest-[ALGORITHM].txt)- Parameters:
rootDir
- the root directory of the bagversion
- the version of the bag- Throws:
MissingPayloadManifestException
- if there are no payload manifests in the bagIOException
- if there was an error reading a file
-