Class AddFileProcessor


  • public class AddFileProcessor
    extends Object
    Encapsulates logic for adding files to an object, both adding them to the inventory and moving them into staging.
    • Constructor Detail

      • AddFileProcessor

        public AddFileProcessor​(InventoryUpdater inventoryUpdater,
                                Path stagingDir,
                                DigestAlgorithm digestAlgorithm)
        Parameters:
        inventoryUpdater - the inventory updater
        stagingDir - the staging directory to move files into
        digestAlgorithm - the digest algorithm
        See Also:
        AddFileProcessor.Builder
    • Method Detail

      • processPath

        public Map<String,​Path> processPath​(Path sourcePath,
                                                  OcflOption... ocflOptions)
        Adds all of the files at or under the sourcePath to the root of the object.
        Parameters:
        sourcePath - the file or directory to add
        ocflOptions - options for how to move the files
        Returns:
        a map of logical paths to their corresponding file within the stagingDir for newly added files
      • processPath

        public Map<String,​Path> processPath​(Path sourcePath,
                                                  String destinationPath,
                                                  OcflOption... options)
        Adds all of the files at or under the sourcePath to the object at the specified destinationPath.
        Parameters:
        sourcePath - the file or directory to add
        destinationPath - the location to insert the file or directory at within the object
        options - options for how to move the files
        Returns:
        a map of logical paths to their corresponding file within the stagingDir for newly added files