Class TikaMetadataExtractor
java.lang.Object
org.craftercms.search.opensearch.impl.tika.TikaMetadataExtractor
- All Implemented Interfaces:
MetadataExtractor<org.apache.tika.metadata.Metadata>
public class TikaMetadataExtractor
extends Object
implements MetadataExtractor<org.apache.tika.metadata.Metadata>
Implementation of
MetadataExtractor
that uses Apache Tika to parse binary files.- Author:
- joseross
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
extract
(org.springframework.core.io.Resource resource, org.apache.tika.metadata.Metadata metadata, Map<String, Object> properties) Takes relevant metadata from the source object to the properties parameterprotected boolean
isSupported
(org.apache.tika.metadata.Metadata metadata) Indicates if the given metadata can be handled by this extractorvoid
setSupportedMimeTypes
(String[] supportedMimeTypes)
-
Field Details
-
supportedMimeTypes
The list of mime types that can be handled by this extractor -
mapping
The mapping of Apache Tika properties to extract
-
-
Constructor Details
-
TikaMetadataExtractor
-
-
Method Details
-
setSupportedMimeTypes
-
isSupported
protected boolean isSupported(org.apache.tika.metadata.Metadata metadata) Indicates if the given metadata can be handled by this extractor- Parameters:
metadata
- the metadata to check- Returns:
- true if the metadata is supported
-
extract
public void extract(org.springframework.core.io.Resource resource, org.apache.tika.metadata.Metadata metadata, Map<String, Object> properties) Takes relevant metadata from the source object to the properties parameter- Specified by:
extract
in interfaceMetadataExtractor<org.apache.tika.metadata.Metadata>
- Parameters:
resource
- the original file containing the metadata (in case any extra operation is needed)metadata
- the object that provides the metadataproperties
- the properties that will be indexed
-