The Plug-in API
The metadata extraction plug-in API allows you to create plug-ins for
both metadata extraction (reading metadata from files) and metadata
injection (inserting metadata into content item fields). Both processes
are managed by the MetadataService
class, which
delegates the actual work to type-specific plug-ins.
Metadata extraction is performed by implementations of the
StreamMetadataExtractor
interface. Metadata injection
is performed by implementations of the
ContentMetadataInjector
interface.
The plug-in API uses the Service Provider facility as described in the JAR file specification for discovery of plug-ins (see http://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#Service_Provider).
A plug-in, then, usually consists of a single JAR file containing:
-
One or more implementation classes
-
A service provider (
Spi
) class for each implementation
Each service provider class is responsible for instantiating the corresponding implementation class.
Metadata Extraction and Storage Plug-ins
The
Content Engine
also supports plug-in implementations of the Storage
interface, which allows developers to add support for different file
storage back ends. Third-party implementations of
Storage
should ideally provide a storage-specific
StorageMetadataExtractor
implementation in order to
enable the use of metadata stored outside the data stream itself
(usually file attributes such as size, last modification date and so
on).