Class CloudOcflStorageBuilder
- java.lang.Object
-
- edu.wisc.library.ocfl.core.storage.cloud.CloudOcflStorageBuilder
-
public class CloudOcflStorageBuilder extends Object
Builder for constructing S3OcflStorage objects. It is configured with sensible defaults and can minimally be used asnew S3OcflStorageBuilder().s3Client(s3Client).workDir(workDir).build(bucketName).
-
-
Constructor Summary
Constructors Constructor Description CloudOcflStorageBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CloudOcflStoragebuild()CloudOcflStorageBuildercloudClient(CloudClient cloudClient)Sets the cloud client.CloudOcflStorageBuilderignoreUnsupportedExtensions(Set<String> ignoreUnsupportedExtensions)Sets a list of unsupported extensions that should be ignored.CloudOcflStorageBuilderinitializer(CloudOcflStorageInitializer initializer)Overrides the defaultCloudOcflStorageInitializer.CloudOcflStorageBuilderobjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)Overrides the default ObjectMapper that's used to serialize ocfl_layout.jsonCloudOcflStorageBuilderunsupportedExtensionBehavior(UnsupportedExtensionBehavior unsupportedBehavior)Set the behavior when an unsupported extension is encountered.
-
-
-
Method Detail
-
cloudClient
public CloudOcflStorageBuilder cloudClient(CloudClient cloudClient)
Sets the cloud client. This must be set prior to calling build().- Parameters:
cloudClient- the client to use to interface with cloud storage such as S3- Returns:
- builder
-
unsupportedExtensionBehavior
public CloudOcflStorageBuilder 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 CloudOcflStorageBuilder 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 CloudOcflStorageBuilder 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
-
initializer
public CloudOcflStorageBuilder initializer(CloudOcflStorageInitializer initializer)
Overrides the defaultCloudOcflStorageInitializer. Normally, this does not need to be set.- Parameters:
initializer- the initializer- Returns:
- builder
-
build
public CloudOcflStorage build()
- Returns:
- a new
CloudOcflStorageobject
-
-