read
public Bag read(java.nio.file.Path rootDir)
throws java.io.IOException,
UnparsableVersionException,
MaliciousPathException,
InvalidBagMetadataException,
UnsupportedAlgorithmException,
InvalidBagitFileFormatException
Read the bag from the filesystem and create a bag object
- Parameters:
rootDir - the root directory of the bag
- Returns:
- a
Bag object representing a bag on the filesystem
- Throws:
java.io.IOException - if there is a problem reading a file
UnparsableVersionException - If there is a problem parsing the bagit version
MaliciousPathException - if there is path that is referenced in the manifest or fetch file that is outside the bag root directory
InvalidBagMetadataException - if the metadata or bagit.txt file does not conform to the bagit spec
UnsupportedAlgorithmException - if the manifest uses a algorithm that isn't supported
InvalidBagitFileFormatException - if the manifest or fetch file is not formatted properly