public final class BagLinter
extends java.lang.Object
IOException )| Modifier and Type | Method and Description |
|---|---|
static void |
checkAgainstProfile(java.io.InputStream jsonProfile,
Bag bag)
Check a bag against a bagit-profile as described by
https://github.com/ruebot/bagit-profiles
Note: This implementation does not check the Serialization part of the profile! |
static java.util.Set<BagitWarning> |
lintBag(java.nio.file.Path rootDir)
The BagIt specification is very flexible in what it allows which leads to situations
where something may be technically allowed, but should be discouraged.
|
static java.util.Set<BagitWarning> |
lintBag(java.nio.file.Path rootDir,
java.util.Collection<BagitWarning> warningsToIgnore)
The BagIt specification is very flexible in what it allows which leads to situations
where something may be technically allowed, but should be discouraged.
|
public static void checkAgainstProfile(java.io.InputStream jsonProfile,
Bag bag)
throws com.fasterxml.jackson.core.JsonParseException,
com.fasterxml.jackson.databind.JsonMappingException,
java.io.IOException,
FetchFileNotAllowedException,
RequiredMetadataFieldNotPresentException,
MetatdataValueIsNotAcceptableException,
RequiredManifestNotPresentException,
BagitVersionIsNotAcceptableException,
RequiredTagFileNotPresentException,
MetatdataValueIsNotRepeatableException
jsonProfile - the input stream to the json string describing the profilebag - the bag to check against the profilejava.io.IOException - if there is a problem reading the profile or some of the bag filescom.fasterxml.jackson.databind.JsonMappingException - if there is a problem mapping the profile to the BagitProfilecom.fasterxml.jackson.core.JsonParseException - if there is a problem parsing the json while mapping to java objectFetchFileNotAllowedException - if there is a fetch file when the profile prohibits itMetatdataValueIsNotAcceptableException - if a metadata value is not in the list of acceptable valuesMetatdataValueIsNotRepeatableException - if a metadata value shows up more than once when not repeatableRequiredMetadataFieldNotPresentException - if a metadata field is not present but it should beRequiredManifestNotPresentException - if a payload or tag manifest type is not present but should beBagitVersionIsNotAcceptableException - if the version of the bag is not in the list of acceptable versionsRequiredTagFileNotPresentException - if a tag file is not present but should bepublic static java.util.Set<BagitWarning> lintBag(java.nio.file.Path rootDir) throws java.io.IOException, UnparsableVersionException, InvalidBagMetadataException, InvalidBagitFileFormatException, MaliciousPathException, UnsupportedAlgorithmException
BagVerifier instead.rootDir - the root directory of the bagBagitWarning detailing all items that should be fixed.InvalidBagMetadataException - if the bag metadata does not conform to the bagit specificationUnparsableVersionException - if there is an error reading the bagit versionjava.io.IOException - if there was an error reading a fileUnsupportedAlgorithmException - if there is an error while reading one of the manifests due to the algorithm being unsupportedMaliciousPathException - if the path is crafted to be malicious (overwrite non bag files)InvalidBagitFileFormatExceptionpublic static java.util.Set<BagitWarning> lintBag(java.nio.file.Path rootDir, java.util.Collection<BagitWarning> warningsToIgnore) throws java.io.IOException, UnparsableVersionException, InvalidBagMetadataException, InvalidBagitFileFormatException, MaliciousPathException, UnsupportedAlgorithmException
BagVerifier instead.rootDir - the root directory of the bagwarningsToIgnore - any BagitWarning to ignore when lintingBagitWarning detailing all items that should be fixed.InvalidBagMetadataException - if the bag metadata does not conform to the bagit specificationUnparsableVersionException - if there is an error reading the bagit versionjava.io.IOException - if there was an error reading a fileUnsupportedAlgorithmException - if there is an error while reading one of the manifests due to the algorithm being unsupportedMaliciousPathException - if the path is crafted to be malicious (overwrite non bag files)InvalidBagitFileFormatException