Interface ContentSync

All Superinterfaces:
TxnComponent
All Known Subinterfaces:
FileSync
All Known Implementing Classes:
FileSyncImpl

public interface ContentSync extends TxnComponent
  • Method Details

    • openCurrentContent

      InputStream openCurrentContent() throws IOException
      Read the most recent content (maybe open the original file). Beware that calling
      invalid reference
      #newOutputStreamToNewTmpContent()
      may practically invalidate the returned input stream.
      Throws:
      IOException
    • newOutputStreamToNewTmpContent

      OutputStream newOutputStreamToNewTmpContent(boolean truncate) throws IOException
      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

      Instant getLastModifiedTime() throws IOException
      Returns null if not exists
      Throws:
      IOException
    • putContent

      void putContent(Consumer<OutputStream> outputStreamSupplier) throws IOException
      Set the new content of a resource. The new content is not committed.
      Parameters:
      outputStreamSupplier -
      Throws:
      IOException
    • markForDeletion

      default void markForDeletion() throws IOException
      Convenience method. Truncates the new content which by default is interpreted as a deletion
      Throws:
      IOException