Package io.ocfl.core
Class DefaultOcflObjectUpdater
java.lang.Object
io.ocfl.core.DefaultOcflObjectUpdater
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionDefaultOcflObjectUpdater
(Inventory inventory, InventoryUpdater inventoryUpdater, Path stagingDir, AddFileProcessor addFileProcessor, FileLocker fileLocker) -
Method Summary
Modifier and TypeMethodDescriptionaddFileFixity
(String logicalPath, DigestAlgorithm algorithm, String value) addPath
(Path sourcePath, OcflOption... options) addPath
(Path sourcePath, String destinationPath, OcflOption... options) boolean
Returns true if the processor deleted a file and thus we need to look for empty directories to delete prior to writing the version.reinstateFile
(VersionNum sourceVersionNum, String sourcePath, String destinationPath, OcflOption... options) removeFile
(String path) renameFile
(String sourcePath, String destinationPath, OcflOption... options) unsafeAddPath
(String digest, Path sourcePath, String destinationPath, OcflOption... options) writeFile
(InputStream input, String destinationPath, OcflOption... options)
-
Constructor Details
-
DefaultOcflObjectUpdater
public DefaultOcflObjectUpdater(Inventory inventory, InventoryUpdater inventoryUpdater, Path stagingDir, AddFileProcessor addFileProcessor, FileLocker fileLocker)
-
-
Method Details
-
addPath
- Specified by:
addPath
in interfaceOcflObjectUpdater
-
addPath
- 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
- 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
- Specified by:
clearVersionState
in interfaceOcflObjectUpdater
-
addFileFixity
- Specified by:
addFileFixity
in interfaceOcflObjectUpdater
-
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
-