Package io.ocfl.core
Class DefaultOcflObjectUpdater
- java.lang.Object
-
- io.ocfl.core.DefaultOcflObjectUpdater
-
- All Implemented Interfaces:
OcflObjectUpdater
public class DefaultOcflObjectUpdater extends Object implements OcflObjectUpdater
Default implementation of OcflObjectUpdater that is used by DefaultOcflRepository to provide write access to an object.This class is thread safe, and you can concurrently use the same updater to add multiple files to the same object version.
-
-
Constructor Summary
Constructors Constructor Description DefaultOcflObjectUpdater(Inventory inventory, InventoryUpdater inventoryUpdater, Path stagingDir, AddFileProcessor addFileProcessor, FileLocker fileLocker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OcflObjectUpdater
addFileFixity(String logicalPath, DigestAlgorithm algorithm, String value)
OcflObjectUpdater
addPath(Path sourcePath, OcflOption... options)
OcflObjectUpdater
addPath(Path sourcePath, String destinationPath, OcflOption... options)
boolean
checkForEmptyDirs()
Returns true if the processor deleted a file and thus we need to look for empty directories to delete prior to writing the version.OcflObjectUpdater
clearFixityBlock()
OcflObjectUpdater
clearVersionState()
OcflObjectUpdater
reinstateFile(VersionNum sourceVersionNum, String sourcePath, String destinationPath, OcflOption... options)
OcflObjectUpdater
removeFile(String path)
OcflObjectUpdater
renameFile(String sourcePath, String destinationPath, OcflOption... options)
OcflObjectUpdater
unsafeAddPath(String digest, Path sourcePath, String destinationPath, OcflOption... options)
OcflObjectUpdater
writeFile(InputStream input, String destinationPath, OcflOption... options)
-
-
-
Constructor Detail
-
DefaultOcflObjectUpdater
public DefaultOcflObjectUpdater(Inventory inventory, InventoryUpdater inventoryUpdater, Path stagingDir, AddFileProcessor addFileProcessor, FileLocker fileLocker)
-
-
Method Detail
-
addPath
public OcflObjectUpdater addPath(Path sourcePath, OcflOption... options)
- Specified by:
addPath
in interfaceOcflObjectUpdater
-
addPath
public OcflObjectUpdater addPath(Path sourcePath, String destinationPath, OcflOption... options)
- Specified by:
addPath
in interfaceOcflObjectUpdater
-
unsafeAddPath
public OcflObjectUpdater unsafeAddPath(String digest, Path sourcePath, String destinationPath, OcflOption... options)
- Specified by:
unsafeAddPath
in interfaceOcflObjectUpdater
-
writeFile
public OcflObjectUpdater writeFile(InputStream input, String destinationPath, OcflOption... options)
- Specified by:
writeFile
in interfaceOcflObjectUpdater
-
removeFile
public OcflObjectUpdater removeFile(String path)
- Specified by:
removeFile
in interfaceOcflObjectUpdater
-
renameFile
public OcflObjectUpdater renameFile(String sourcePath, String destinationPath, OcflOption... options)
- Specified by:
renameFile
in interfaceOcflObjectUpdater
-
reinstateFile
public OcflObjectUpdater reinstateFile(VersionNum sourceVersionNum, String sourcePath, String destinationPath, OcflOption... options)
- Specified by:
reinstateFile
in interfaceOcflObjectUpdater
-
clearVersionState
public OcflObjectUpdater clearVersionState()
- Specified by:
clearVersionState
in interfaceOcflObjectUpdater
-
addFileFixity
public OcflObjectUpdater addFileFixity(String logicalPath, DigestAlgorithm algorithm, String value)
- Specified by:
addFileFixity
in interfaceOcflObjectUpdater
-
clearFixityBlock
public OcflObjectUpdater clearFixityBlock()
- Specified by:
clearFixityBlock
in interfaceOcflObjectUpdater
-
checkForEmptyDirs
public boolean checkForEmptyDirs()
Returns true if the processor deleted a file and thus we need to look for empty directories to delete prior to writing the version.- Returns:
- true if we need to look for empty directories
-
-