Class NoopDatabaseBackedContentManager

java.lang.Object
nl.knaw.dans.layerstore.NoopDatabaseBackedContentManager
All Implemented Interfaces:
DatabaseBackedContentManager

public class NoopDatabaseBackedContentManager extends Object implements DatabaseBackedContentManager
  • Constructor Details

    • NoopDatabaseBackedContentManager

      public NoopDatabaseBackedContentManager()
  • Method Details

    • test

      public boolean test(String path)
      Description copied from interface: DatabaseBackedContentManager
      Test if the content at the given path should be stored in the database.
      Specified by:
      test in interface DatabaseBackedContentManager
      Parameters:
      path - the path of the content relative to the root of store
      Returns:
      true if the content should be stored in the database, false otherwise
    • preStore

      public byte[] preStore(String path, byte[] bytes)
      Description copied from interface: DatabaseBackedContentManager
      Process the content before it is stored in the database. The path of the file is also provided, so that the processor can decide to process the content based on the path. Note that the implementation should take care to select the same paths as in DatabaseBackedContentManager.postRetrieve(String, byte[])

      The most important use case for this method is to compress the content before it is stored in the database.

      Specified by:
      preStore in interface DatabaseBackedContentManager
      Parameters:
      path - the path of the content relative to the root of store
      bytes - the content to be stored
      Returns:
      the processed content
    • postRetrieve

      public byte[] postRetrieve(String path, byte[] bytes)
      Description copied from interface: DatabaseBackedContentManager
      Process the content after it is retrieved from the database. The path of the file is also provided, so that the processor can decide to process the content based on the path. Note that the implementation should take care to select the same paths as in DatabaseBackedContentManager.preStore(String, byte[])

      The most important use case for this method is to decompress the content after it is retrieved from the database (assuming it was compressed before it was stored).

      Specified by:
      postRetrieve in interface DatabaseBackedContentManager
      Parameters:
      path - the path of the content relative to the root of store
      bytes - the content to be processed
      Returns:
      the processed content