Package io.ocfl.api

Class OcflConfig


  • public class OcflConfig
    extends Object
    Contains OCFL related configuration options. All values are defaulted.
    • Constructor Detail

      • OcflConfig

        public OcflConfig()
      • OcflConfig

        public OcflConfig​(OcflConfig original)
    • Method Detail

      • setOcflVersion

        public OcflConfig setOcflVersion​(OcflVersion ocflVersion)
        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
      • setDefaultDigestAlgorithm

        public OcflConfig setDefaultDigestAlgorithm​(DigestAlgorithm defaultDigestAlgorithm)
        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

        public DigestAlgorithm getDefaultDigestAlgorithm()
      • setDefaultContentDirectory

        public OcflConfig setDefaultContentDirectory​(String defaultContentDirectory)
        Set the default content directory to use when creating new inventories. MUST NOT contain / or \. Default: contents
        Parameters:
        defaultContentDirectory - content directory
        Returns:
        config
      • getDefaultContentDirectory

        public String getDefaultContentDirectory()
      • getDefaultZeroPaddingWidth

        public int getDefaultZeroPaddingWidth()
      • setDefaultZeroPaddingWidth

        public OcflConfig setDefaultZeroPaddingWidth​(int defaultZeroPaddingWidth)
        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

        public OcflConfig 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. 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