Package org.fcrepo.persistence.ocfl.impl
Class OcflPersistentStorageUtils
- java.lang.Object
-
- org.fcrepo.persistence.ocfl.impl.OcflPersistentStorageUtils
-
public class OcflPersistentStorageUtils extends Object
A set of utility functions for supporting OCFL persistence activities.- Since:
- 6.0.0
- Author:
- dbernstein
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static edu.wisc.library.ocfl.api.MutableOcflRepository
createFilesystemRepository(Path ocflStorageRootDir, Path ocflWorkDir, DigestAlgorithm algorithm)
Create a new ocfl repository backed by the filesystemstatic edu.wisc.library.ocfl.api.MutableOcflRepository
createS3Repository(DataSource dataSource, software.amazon.awssdk.services.s3.S3Client s3Client, String bucket, String prefix, Path ocflWorkDir, DigestAlgorithm algorithm, boolean withDb)
Create a new ocfl repository backed by s3static String
getRDFFileExtension()
static org.apache.jena.riot.RDFFormat
getRdfFormat()
static com.fasterxml.jackson.databind.ObjectMapper
objectMapper()
static edu.wisc.library.ocfl.api.model.DigestAlgorithm
translateFedoraDigestToOcfl(DigestAlgorithm fcrepoAlg)
Translates the provided fedora digest algorithm enum into a OCFL client digest algorithm
-
-
-
Method Detail
-
getRdfFormat
public static org.apache.jena.riot.RDFFormat getRdfFormat()
- Returns:
- the RDF Format. By default NTRIPLES are returned.
-
getRDFFileExtension
public static String getRDFFileExtension()
- Returns:
- the RDF file extension.
-
createFilesystemRepository
public static edu.wisc.library.ocfl.api.MutableOcflRepository createFilesystemRepository(Path ocflStorageRootDir, Path ocflWorkDir, DigestAlgorithm algorithm) throws IOException
Create a new ocfl repository backed by the filesystem- Parameters:
ocflStorageRootDir
- The ocfl storage root directoryocflWorkDir
- The ocfl work directoryalgorithm
- the algorithm for the OCFL repository- Returns:
- the repository
- Throws:
IOException
-
createS3Repository
public static edu.wisc.library.ocfl.api.MutableOcflRepository createS3Repository(DataSource dataSource, software.amazon.awssdk.services.s3.S3Client s3Client, String bucket, String prefix, Path ocflWorkDir, DigestAlgorithm algorithm, boolean withDb) throws IOException
Create a new ocfl repository backed by s3- Parameters:
dataSource
- the datasource to keep inventories in and use as a locks3Client
- aws s3 clientbucket
- the bucket to store objects inprefix
- the prefix within the bucket to store objects underocflWorkDir
- the local directory to stage objects inalgorithm
- the algorithm for the OCFL repositorywithDb
- true if the ocfl client should use a db- Returns:
- the repository
- Throws:
IOException
-
objectMapper
public static com.fasterxml.jackson.databind.ObjectMapper objectMapper()
- Returns:
- new object mapper with default config
-
translateFedoraDigestToOcfl
public static edu.wisc.library.ocfl.api.model.DigestAlgorithm translateFedoraDigestToOcfl(DigestAlgorithm fcrepoAlg)
Translates the provided fedora digest algorithm enum into a OCFL client digest algorithm- Parameters:
fcrepoAlg
- fedora digest algorithm- Returns:
- OCFL client DigestAlgorithm, or null if no match could be made
-
-