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
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final org.slf4j.Loggerprivate static final ResourceBundle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckBagitFileExists(Path rootDir, Version version) make sure the bagit.txt file existsstatic voidcheckFetchItemsExist(List<FetchItem> items, Path bagDir) make sure all the fetch items exist in the data directorystatic voidcheckIfAtLeastOnePayloadManifestsExist(Path rootDir, Version version) Check to make sure the bag has at least one payload manifest (manifest-[ALGORITHM].txt)static voidMake 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
-