Class OcflPersistentStorageUtils

    • Method Detail

      • getRdfFormat

        public static org.apache.jena.riot.RDFFormat getRdfFormat()
        Returns:
        the RDF Format. By default NTRIPLES are returned.
      • 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 directory
        ocflWorkDir - The ocfl work directory
        algorithm - 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 lock
        s3Client - aws s3 client
        bucket - the bucket to store objects in
        prefix - the prefix within the bucket to store objects under
        ocflWorkDir - the local directory to stage objects in
        algorithm - the algorithm for the OCFL repository
        withDb - 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