Interface ContentService

All Known Implementing Classes:
GridFsContentService, S3ContentService

public interface ContentService
Abstraction over the persistence mechanism used to store node content. Implementations handle saving, retrieving and deleting binary files as well as computing cryptographic hashes.
  • Method Details

    • archiveNodeContent

      void archiveNodeContent(org.alfresco.core.model.Node node, InputStream inputStream)
      Saves the content of the provided node into the underlying store.
      Parameters:
      node - node whose content should be archived
      inputStream - stream providing the node content
    • getNodeContent

      NodeContentStream getNodeContent(String nodeId)
      Retrieves previously archived content for the given node id.
      Parameters:
      nodeId - identifier of the node
      Returns:
      a NodeContentStream descriptor containing stream and metadata
    • getNodeContentInfo

      NodeContentInfo getNodeContentInfo(String nodeId)
      Retrieves only metadata information about the stored content of the given node without returning the binary stream.
      Parameters:
      nodeId - identifier of the node
      Returns:
      a NodeContentInfo descriptor populated with file name, content type and checksum details
    • deleteNodeContent

      void deleteNodeContent(String nodeId)
      Deletes content associated with the given node id from the store.
      Parameters:
      nodeId - identifier of the node
    • computeHash

      String computeHash(String nodeId, String algorithm)
      Computes the cryptographic hash of a stored node's content using the given algorithm.
      Parameters:
      nodeId - identifier of the node
      algorithm - name of the hash algorithm, e.g. MD5 or SHA-256
      Returns:
      the hexadecimal encoded hash string