Interface MutableChecksumsSFV

All Superinterfaces:
ImmutableChecksumsSFV
All Known Implementing Classes:
SfvChecksumImpl

public interface MutableChecksumsSFV extends ImmutableChecksumsSFV
Mutable checksum collection in simple file verification (SFV) file format
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    updateFromBytes(String fileName, byte[] bytes)
    Update the checksum collection, and add a new checksum from given bytes, likely a read file or soon to be written file.
    void
    updateFromChecksum(Path filePath, long checksum)
    Update the checksum map with the given checksum
    void
    updateFromFile(Path filePath)
    Update the checksum collection, and add a new checksum from a given file path.
    void
    Build the checksum collection from a SFV format string array.

    Methods inherited from interface io.camunda.zeebe.snapshots.ImmutableChecksumsSFV

    getChecksums, sameChecksums, write
  • Method Details

    • updateFromFile

      void updateFromFile(Path filePath) throws IOException
      Update the checksum collection, and add a new checksum from a given file path.
      Parameters:
      filePath - the path to a file for which a checksum is created and added to the collection
      Throws:
      IOException - when reading of given file fails
    • updateFromBytes

      void updateFromBytes(String fileName, byte[] bytes)
      Update the checksum collection, and add a new checksum from given bytes, likely a read file or soon to be written file.

      Useful, if we want to avoid re-reading files etc.

      Parameters:
      fileName - the name of the file (which relates to the given bytes), that is used in the checksum collection in SFV file format
      bytes - the bytes for which the checksum should be created
    • updateFromSfvFile

      void updateFromSfvFile(String... lines)
      Build the checksum collection from a SFV format string array.
      Parameters:
      lines - the lines (in SFV) to build up the checksum collection
    • updateFromChecksum

      void updateFromChecksum(Path filePath, long checksum)
      Update the checksum map with the given checksum
      Parameters:
      filePath - path to file
      checksum - check of file given