Class OcflStorageBuilder
- java.lang.Object
-
- edu.wisc.library.ocfl.core.storage.OcflStorageBuilder
-
public class OcflStorageBuilder extends Object
Builder for constructingOcflStorageobjects. It is configured with sensible defaults and can minimally be used asOcflStorageBuilder.builder().fileSystem(storageRoot).build().
-
-
Constructor Summary
Constructors Constructor Description OcflStorageBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OcflStoragebuild()Creates aOcflStorageobject.static OcflStorageBuilderbuilder()OcflStorageBuildercloud(CloudClient cloudClient)Configure cloud based storage implementation.OcflStorageBuilderfileSystem(Path storageRoot)Configure local filesystem based storage implementation.OcflStorageBuilderinitializer(OcflStorageInitializer initializer)Overrides the defaultOcflStorageInitializer.OcflStorageBuilderobjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)Overrides the default ObjectMapper that's used to serialize ocfl_layout.jsonOcflStorageBuilderstorage(Storage storage)Set the storage implementation to use.OcflStorageBuilderverifyInventoryDigest(boolean verifyInventoryDigest)Configures whether inventory digests should be verified on read.
-
-
-
Method Detail
-
builder
public static OcflStorageBuilder builder()
-
storage
public OcflStorageBuilder storage(Storage storage)
Set the storage implementation to use. This method,fileSystem(Path), orcloud(CloudClient)must be used.- Parameters:
storage- storage implementation- Returns:
- builder
-
fileSystem
public OcflStorageBuilder fileSystem(Path storageRoot)
Configure local filesystem based storage implementation. This method,storage(Storage), orcloud(CloudClient)must be used.- Parameters:
storageRoot- path to the OCFL storage root directory- Returns:
- builder
-
cloud
public OcflStorageBuilder cloud(CloudClient cloudClient)
Configure cloud based storage implementation. This method,storage(Storage), orfileSystem(Path)must be used.- Parameters:
cloudClient- client to use to connect to the cloud storage- Returns:
- builder
-
objectMapper
public OcflStorageBuilder 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 OcflStorageBuilder initializer(OcflStorageInitializer initializer)
Overrides the defaultOcflStorageInitializer. Normally, this does not need to be set.- Parameters:
initializer- the initializer- Returns:
- builder
-
verifyInventoryDigest
public OcflStorageBuilder verifyInventoryDigest(boolean verifyInventoryDigest)
Configures whether inventory digests should be verified on read. This means computing the digest of the inventory file and comparing it with the digest in the inventory's sidecar. Default: true.- Parameters:
verifyInventoryDigest- true if inventory digests should be verified on read- Returns:
- builder
-
build
public OcflStorage build()
Creates aOcflStorageobject. One ofstorage(Storage),fileSystem(Path), orcloud(CloudClient)must be called before calling this method.- Returns:
- a new
OcflStorageobject
-
-