Interface ContentSync
- All Superinterfaces:
TxnComponent
- All Known Subinterfaces:
FileSync
- All Known Implementing Classes:
FileSyncImpl
-
Method Summary
Modifier and TypeMethodDescriptionbooleanexists()Returns true iff there is at least one backing resource with the old or new stateReturns null if not existsdefault voidConvenience method.newOutputStreamToNewTmpContent(boolean truncate) Open an output stream to the tmp content.Read the most recent content (maybe open the original file).voidputContent(Consumer<OutputStream> outputStreamSupplier) Set the new content of a resource.Methods inherited from interface TxnComponent
finalizeCommit, preCommit, rollback
-
Method Details
-
openCurrentContent
Read the most recent content (maybe open the original file). Beware that callingmay practically invalidate the returned input stream.invalid reference
#newOutputStreamToNewTmpContent()- Throws:
IOException
-
newOutputStreamToNewTmpContent
Open an output stream to the tmp content. If the new content is currently a symlink then it gets deleted and replaced with a regular file- Throws:
IOException
-
exists
boolean exists()Returns true iff there is at least one backing resource with the old or new state -
getLastModifiedTime
-
putContent
Set the new content of a resource. The new content is not committed.- Parameters:
outputStreamSupplier-- Throws:
IOException
-
markForDeletion
Convenience method. Truncates the new content which by default is interpreted as a deletion- Throws:
IOException
-