Class KeyStrategyDigest

java.lang.Object
org.nuxeo.ecm.core.blob.KeyStrategyDigest
All Implemented Interfaces:
KeyStrategy

public class KeyStrategyDigest extends Object implements KeyStrategy
Represents computation of blob keys based on a message digest.
Since:
11.1
  • Field Details

    • digestAlgorithm

      public final String digestAlgorithm
    • digestPattern

      public final Pattern digestPattern
  • Constructor Details

    • KeyStrategyDigest

      public KeyStrategyDigest(String digestAlgorithm)
  • Method Details

    • useDeDuplication

      public boolean useDeDuplication()
      Description copied from interface: KeyStrategy
      Checks whether this key strategy uses de-duplication. When de-duplication is used, two blobs with identical contents have identical keys.
      Specified by:
      useDeDuplication in interface KeyStrategy
    • getDigestFromKey

      public String getDigestFromKey(String key)
      Description copied from interface: KeyStrategy
      Gets, if possible, a digest from the key. This is not possible if the key is not derived from a digest.
      Specified by:
      getDigestFromKey in interface KeyStrategy
      Parameters:
      key - the key
      Returns:
      a digest, or null
    • isValidDigest

      public boolean isValidDigest(String key)
    • getDigestPattern

      protected static Pattern getDigestPattern(String digestAlgorithm)
    • getBlobWriteContext

      public BlobWriteContext getBlobWriteContext(BlobContext blobContext)
      Description copied from interface: KeyStrategy
      Gets the write context for the given blob.
      Specified by:
      getBlobWriteContext in interface KeyStrategy
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isValidKey

      public boolean isValidKey(String key)
      Description copied from interface: KeyStrategy
      Does the given key have the expected pattern for this strategy.
      Specified by:
      isValidKey in interface KeyStrategy