Class AbstractMetadataExtractor
java.lang.Object
org.craftercms.search.metadata.impl.AbstractMetadataExtractor
- All Implemented Interfaces:
MetadataExtractor
- Direct Known Subclasses:
ContentTypeMetadataExtractor
,FileSizeMetadataExtractor
,InternalNameMetadataExtractor
Base implementation of
MetadataExtractor
- Since:
- 3.1.1
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionPattern of files that should be included -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoExtract
(String path, org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.core.service.Context context) Performs the actual metadata extractionextract
(String path, org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.core.service.Context context) Performs the metadata extraction on the given fileprotected abstract boolean
isCompatible
(String path, org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.core.service.Context context) Checks if a given file should be processed by the current instancevoid
setIncludePatterns
(List<String> includePatterns)
-
Field Details
-
includePatterns
Pattern of files that should be included
-
-
Constructor Details
-
AbstractMetadataExtractor
public AbstractMetadataExtractor()
-
-
Method Details
-
setIncludePatterns
-
extract
public Map<String,Object> extract(String path, org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.core.service.Context context) Performs the metadata extraction on the given file- Specified by:
extract
in interfaceMetadataExtractor
- Parameters:
path
- the path of the file to processcontentStoreService
- the content store servicecontext
- the current context- Returns:
- the extracted metadata
-
isCompatible
protected abstract boolean isCompatible(String path, org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.core.service.Context context) Checks if a given file should be processed by the current instance- Parameters:
path
- the path of the file to checkcontentStoreService
- the content store servicecontext
- the current context- Returns:
- true if the file should be processed
-
doExtract
protected abstract Map<String,Object> doExtract(String path, org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.core.service.Context context) Performs the actual metadata extraction- Parameters:
path
- the path of the filecontentStoreService
- the content store servicecontext
- the current context- Returns:
- the extracted metadata
-