Class FileSystemOcflStorageBuilder
- java.lang.Object
-
- edu.wisc.library.ocfl.core.storage.filesystem.FileSystemOcflStorageBuilder
-
public class FileSystemOcflStorageBuilder extends Object
Builder for constructing FileSystemOcflStorage objects. It is configured with sensible defaults and can minimally be used asFileSystemOcflStorage.builder().repositoryRoot(repoRoot).build()
-
-
Constructor Summary
Constructors Constructor Description FileSystemOcflStorageBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileSystemOcflStoragebuild()Builds a new FileSystemOcflStorage objectFileSystemOcflStorageBuildercheckNewVersionFixity(boolean checkNewVersionFixity)Overrides whether the fixity of new version content should be checked on version creation after moving the version into the OCFL object root.FileSystemOcflStorageBuilderignoreUnsupportedExtensions(Set<String> ignoreUnsupportedExtensions)Sets a list of unsupported extensions that should be ignored.FileSystemOcflStorageBuilderinitializer(FileSystemOcflStorageInitializer initializer)Overrides the defaultFileSystemOcflStorageInitializer.FileSystemOcflStorageBuilderobjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)Overrides the default ObjectMapper that's used to serialize ocfl_layout.jsonFileSystemOcflStorageBuilderrepositoryRoot(Path repositoryRoot)Sets the path to the OCFL repository root directory.FileSystemOcflStorageBuilderunsupportedExtensionBehavior(UnsupportedExtensionBehavior unsupportedBehavior)Set the behavior when an unsupported extension is encountered.
-
-
-
Method Detail
-
repositoryRoot
public FileSystemOcflStorageBuilder repositoryRoot(Path repositoryRoot)
Sets the path to the OCFL repository root directory. Required.- Parameters:
repositoryRoot- the path to the OCFL storage root- Returns:
- builder
-
unsupportedExtensionBehavior
public FileSystemOcflStorageBuilder unsupportedExtensionBehavior(UnsupportedExtensionBehavior unsupportedBehavior)
Set the behavior when an unsupported extension is encountered. By default, ocfl-java will not operate on repositories or objects that contain unsupported extensions. Set this value to WARN, if you'd like ocfl-java to log a WARNing, but continue to operate instead.Specific unsupported extensions may be ignored individually using
ignoreUnsupportedExtensions- Parameters:
unsupportedBehavior- FAIL to throw an exception or WARN to log a warning- Returns:
- builder
-
ignoreUnsupportedExtensions
public FileSystemOcflStorageBuilder ignoreUnsupportedExtensions(Set<String> ignoreUnsupportedExtensions)
Sets a list of unsupported extensions that should be ignored. If the unsupported extension behavior is set to FAIL, this means that these extensions will produce log WARNings if they are encountered. If the behavior is set to WARN, then these extensions will be silently ignored.- Parameters:
ignoreUnsupportedExtensions- set of unsupported extension names that should be ignored- Returns:
- builder
-
objectMapper
public FileSystemOcflStorageBuilder objectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Overrides the default ObjectMapper that's used to serialize ocfl_layout.json- Parameters:
objectMapper- object mapper- Returns:
- builder
-
checkNewVersionFixity
public FileSystemOcflStorageBuilder checkNewVersionFixity(boolean checkNewVersionFixity)
Overrides whether the fixity of new version content should be checked on version creation after moving the version into the OCFL object root. Unless the work directory is on a different volume, it is unlikely that this check is needed. Default: false- Parameters:
checkNewVersionFixity- whether to check fixity on version creation. Default: false- Returns:
- builder
-
initializer
public FileSystemOcflStorageBuilder initializer(FileSystemOcflStorageInitializer initializer)
Overrides the defaultFileSystemOcflStorageInitializer. Normally, this does not need to be set.- Parameters:
initializer- the initializer- Returns:
- builder
-
build
public FileSystemOcflStorage build()
Builds a new FileSystemOcflStorage object- Returns:
- file system storage
-
-