Package io.ocfl.api
Class OcflConfig
java.lang.Object
io.ocfl.api.OcflConfig
Contains OCFL related configuration options. All values are defaulted.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
setDefaultContentDirectory
(String defaultContentDirectory) Set the default content directory to use when creating new inventories.setDefaultDigestAlgorithm
(DigestAlgorithm defaultDigestAlgorithm) Set the default digest algorithm to use when creating new inventories.setDefaultZeroPaddingWidth
(int defaultZeroPaddingWidth) Set the default zero padding width to use in version numbers in newly created objects.setOcflVersion
(OcflVersion ocflVersion) Set the default OCFL version to use when creating new inventories.setUpgradeObjectsOnWrite
(boolean upgradeObjectsOnWrite) When set to true, existing objects that adhere to an older version of the OCFL spec will be upgraded to the configured OCFL version when they are written to.toString()
-
Constructor Details
-
OcflConfig
public OcflConfig() -
OcflConfig
-
-
Method Details
-
setOcflVersion
Set the default OCFL version to use when creating new inventories. If this value is null, then it's defaulted to the OCFL version in the storage root.- Parameters:
ocflVersion
- ocfl version- Returns:
- config
-
getOcflVersion
-
setDefaultDigestAlgorithm
Set the default digest algorithm to use when creating new inventories. MUST be sha-256 or sha-512. Default: sha-512- Parameters:
defaultDigestAlgorithm
- digest algorithm- Returns:
- config
-
getDefaultDigestAlgorithm
-
setDefaultContentDirectory
Set the default content directory to use when creating new inventories. MUST NOT contain / or \. Default: contents- Parameters:
defaultContentDirectory
- content directory- Returns:
- config
-
getDefaultContentDirectory
-
getDefaultZeroPaddingWidth
public int getDefaultZeroPaddingWidth() -
setDefaultZeroPaddingWidth
Set the default zero padding width to use in version numbers in newly created objects. Default: 0- Parameters:
defaultZeroPaddingWidth
- zero padding width- Returns:
- config
-
isUpgradeObjectsOnWrite
public boolean isUpgradeObjectsOnWrite() -
setUpgradeObjectsOnWrite
When set to true, existing objects that adhere to an older version of the OCFL spec will be upgraded to the configured OCFL version when they are written to. For example, if the repository is configured for OCFL 1.1, then existing 1.0 objects will be upgraded to 1.1 the next time they are written to. This is defaulted to false.- Parameters:
upgradeObjectsOnWrite
- true to upgrade existing OCFL objects on write
-
toString
-