public final class BagitTextFileReader
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static Version |
parseVersion(java.lang.String version) |
static java.util.AbstractMap.SimpleImmutableEntry<Version,java.nio.charset.Charset> |
readBagitTextFile(java.nio.file.Path bagitFile)
Read the bagit.txt file and return the version and encoding.
|
public static java.util.AbstractMap.SimpleImmutableEntry<Version,java.nio.charset.Charset> readBagitTextFile(java.nio.file.Path bagitFile) throws java.io.IOException, UnparsableVersionException, InvalidBagMetadataException, InvalidBagitFileFormatException
bagitFile - the bagit.txt fileVersion and Charset encoding of the tag filesjava.io.IOException - if there is a problem reading a file. The file MUST be in UTF-8 encoding.UnparsableVersionException - if there is a problem parsing the bagit version numberInvalidBagMetadataException - if the bagit.txt file does not conform to "key: value"InvalidBagitFileFormatException - if the bagit.txt file does not conform to the bagit specpublic static Version parseVersion(java.lang.String version) throws UnparsableVersionException
UnparsableVersionException