Package nl.knaw.dans.bagit.reader
Class FetchReader
java.lang.Object
nl.knaw.dans.bagit.reader.FetchReader
This class is responsible for reading and parsing fetch.txt file from the filesystem
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
private static final org.slf4j.Logger
private static final ResourceBundle
-
Constructor Summary
-
Method Summary
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
messages
-
FETCH_LINE_REGEX
- See Also:
-
-
Constructor Details
-
FetchReader
private FetchReader()
-
-
Method Details
-
readFetch
public static List<FetchItem> readFetch(Path fetchFile, Charset encoding, Path bagRootDir) throws IOException, MaliciousPathException, InvalidBagitFileFormatException Reads a fetch.txt file- Parameters:
fetchFile
- the specific fetch fileencoding
- the encoding to read the file withbagRootDir
- the root directory of the bag- Returns:
- a list of items to fetch
- Throws:
IOException
- if there is a problem reading a fileMaliciousPathException
- if the path was crafted to point outside the bag directoryInvalidBagitFileFormatException
- if the fetch format does not follow the bagit specification
-