| Modifier and Type | Field and Description |
|---|---|
static String |
BAGIT_VERSION
Version of the BagIt specification implemented
|
| Constructor and Description |
|---|
BagWriter(File bagDir,
Set<BagItDigest> algorithms)
Create a new, empty Bag
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTags(String key,
Map<String,String> values)
Add tags (metadata) to the Bag.
|
File |
getRootDir()
Get the Bag's root directory
|
Map<String,String> |
getTags(String key)
Get the current tag (metadata) of the Bag
|
void |
registerChecksums(BagItDigest algorithm,
Map<File,String> filemap)
Register checksums of payload (data) files
|
void |
write()
Write metadata and finalize Bag
|
public static String BAGIT_VERSION
public BagWriter(File bagDir, Set<BagItDigest> algorithms)
bagDir - The base directory for the Bag (will be created if it doesn't exist)algorithms - Set of digest algorithms to use for manifests (e.g., "md5", "sha1", or "sha256")public File getRootDir()
public void registerChecksums(BagItDigest algorithm, Map<File,String> filemap)
algorithm - Checksum digest algorithm name (e.g., "SHA-1")filemap - Map of Files to checksum valuespublic void addTags(String key, Map<String,String> values)
key already exists, the values will be appended to the
existing entry.key - Filename of the tag file (e.g., "bag-info.txt")values - Map containing field/value pairspublic Map<String,String> getTags(String key)
key - Filename of the tag file (e.g., "bag-info.txt")public void write() throws IOException
IOException - when an I/O error occursCopyright © 2020. All rights reserved.