Package nl.knaw.dans.bagit.reader
Class BagReader
java.lang.Object
nl.knaw.dans.bagit.reader.BagReader
Responsible for reading a bag from the filesystem.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRead the bag from the filesystem and create a bag object
-
Field Details
-
nameMapping
-
-
Constructor Details
-
BagReader
public BagReader() -
BagReader
-
-
Method Details
-
read
public Bag read(Path rootDir) throws 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:
IOException
- if there is a problem reading a fileUnparsableVersionException
- If there is a problem parsing the bagit versionMaliciousPathException
- if there is path that is referenced in the manifest or fetch file that is outside the bag root directoryInvalidBagMetadataException
- if the metadata or bagit.txt file does not conform to the bagit specUnsupportedAlgorithmException
- if the manifest uses a algorithm that isn't supportedInvalidBagitFileFormatException
- if the manifest or fetch file is not formatted properly
-
getNameMapping
-