Package nl.knaw.dans.layerstore
Class NoopDatabaseBackedContentManager
java.lang.Object
nl.knaw.dans.layerstore.NoopDatabaseBackedContentManager
- All Implemented Interfaces:
DatabaseBackedContentManager
public class NoopDatabaseBackedContentManager
extends Object
implements DatabaseBackedContentManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
postRetrieve
(String path, byte[] bytes) Process the content after it is retrieved from the database.byte[]
Process the content before it is stored in the database.boolean
Test if the content at the given path should be stored in the database.
-
Constructor Details
-
NoopDatabaseBackedContentManager
public NoopDatabaseBackedContentManager()
-
-
Method Details
-
test
Description copied from interface:DatabaseBackedContentManager
Test if the content at the given path should be stored in the database.- Specified by:
test
in interfaceDatabaseBackedContentManager
- 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
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 inDatabaseBackedContentManager.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 interfaceDatabaseBackedContentManager
- Parameters:
path
- the path of the content relative to the root of storebytes
- the content to be stored- Returns:
- the processed content
-
postRetrieve
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 inDatabaseBackedContentManager.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 interfaceDatabaseBackedContentManager
- Parameters:
path
- the path of the content relative to the root of storebytes
- the content to be processed- Returns:
- the processed content
-