public class BagProfile extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BagProfile.BuiltIn
Enum of the built in profiles which are provided with bagit-support
|
static class |
BagProfile.Serialization |
| Constructor and Description |
|---|
BagProfile(BagProfile.BuiltIn builtInProfile)
Load a BagProfile from a
BagProfile.BuiltIn profile type |
BagProfile(InputStream in)
Create a BagProfile from a given InputStream
|
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getAcceptedBagItVersions()
Get the supported BagIt versions
|
Set<String> |
getAcceptedSerializations()
Get the supported serialization formats
If
getSerialization() has a value of required or optional, at least one value is needed. |
Set<String> |
getAllowedPayloadAlgorithms()
Get the payload algorithms which are allowed
When specified along with
getPayloadDigestAlgorithms(), this must include at least all of the
manifest types listed in getPayloadDigestAlgorithms(). |
Set<String> |
getAllowedTagAlgorithms()
Get the tag manifest algorithms which are allowed.
|
String |
getIdentifier()
Retrieve the BagIt-Profile-Identifier for this profile
|
Map<String,ProfileFieldRule> |
getMetadataFields()
Get the required Bag-Info metadata fields.
|
Map<String,ProfileFieldRule> |
getMetadataFields(String tagFile)
Get the required tags for the extra tag file
|
Set<String> |
getPayloadDigestAlgorithms()
Get the required digest algorithms for payload manifests.
|
Map<String,String> |
getProfileMetadata()
Get the BagIt-Profile-Info section describing the BagIt Profile
|
Set<String> |
getSectionNames()
Get all the section names in this profile, which can be used with getMetadataFields().
|
BagProfile.Serialization |
getSerialization()
Get the support of serialization for a Bag.
|
Set<String> |
getTagDigestAlgorithms()
Get the required digest algorithms for tag manifests.
|
Set<String> |
getTagFilesAllowed()
Get the names of allowed tag files; supports unix style globbing
All the tag files listed in
getTagFilesRequired() must be in included in this |
Set<String> |
getTagFilesRequired()
Get the tag files which are required to exist
|
boolean |
isAllowFetch()
Boolean flag allowing a fetch.txt file
|
void |
validateBag(gov.loc.repository.bagit.domain.Bag bag)
Validate a given
Bag against the current profile |
void |
validateConfig(BagConfig config)
Validate a given BagConfig against the current profile
|
void |
validateTagFiles(Map<String,Map<String,String>> config)
Validate a configuration for tag files based on a mapping of BagIt tag filenames to key-value pairs.
|
public BagProfile(BagProfile.BuiltIn builtInProfile) throws IOException
BagProfile.BuiltIn profile typebuiltInProfile - the supported profile to loadIOException - if there is an error reading the jsonpublic BagProfile(InputStream in) throws IOException
in - InputStream containing the Bag profile JSON documentIOException - when there is an I/O error reading JSONpublic String getIdentifier()
public boolean isAllowFetch()
public BagProfile.Serialization getSerialization()
public Set<String> getAcceptedBagItVersions()
public Set<String> getAcceptedSerializations()
getSerialization() has a value of required or optional, at least one value is needed.
If getSerialization() is forbidden, this has no meaningpublic Set<String> getTagFilesAllowed()
getTagFilesRequired() must be in included in thispublic Set<String> getTagFilesRequired()
public Set<String> getAllowedPayloadAlgorithms()
getPayloadDigestAlgorithms(), this must include at least all of the
manifest types listed in getPayloadDigestAlgorithms().public Set<String> getAllowedTagAlgorithms()
getTagDigestAlgorithms(), this must include at least all of the tag
manifest types listed in getTagDigestAlgorithms().public Set<String> getPayloadDigestAlgorithms()
public Set<String> getTagDigestAlgorithms()
public Map<String,ProfileFieldRule> getMetadataFields()
public Map<String,ProfileFieldRule> getMetadataFields(String tagFile)
tagFile - the tag file to get tags forpublic Set<String> getSectionNames()
public Map<String,String> getProfileMetadata()
public void validateConfig(BagConfig config)
config - the BagConfigpublic void validateTagFiles(Map<String,Map<String,String>> config)
config - the Map containing the configuration of BagIt tag filespublic void validateBag(gov.loc.repository.bagit.domain.Bag bag)
Bag against the current profilebag - the BagCopyright © 2020. All rights reserved.