Class FileSizeMetadataExtractor
java.lang.Object
org.craftercms.search.metadata.impl.AbstractMetadataExtractor
org.craftercms.search.metadata.impl.FileSizeMetadataExtractor
- All Implemented Interfaces:
MetadataExtractor
Implementation of
MetadataExtractor
for the file size field- Since:
- 3.1.1
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected String
The name of the metadata property to returnFields inherited from class org.craftercms.search.metadata.impl.AbstractMetadataExtractor
includePatterns
-
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 extractionprotected 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
setPropertyName
(String propertyName) Methods inherited from class org.craftercms.search.metadata.impl.AbstractMetadataExtractor
extract, setIncludePatterns
-
Field Details
-
DEFAULT_PROPERTY_NAME
- See Also:
-
propertyName
The name of the metadata property to return
-
-
Constructor Details
-
FileSizeMetadataExtractor
public FileSizeMetadataExtractor()
-
-
Method Details
-
setPropertyName
-
isCompatible
protected 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- Specified by:
isCompatible
in classAbstractMetadataExtractor
- 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 Map<String,Object> doExtract(String path, org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.core.service.Context context) Performs the actual metadata extraction- Specified by:
doExtract
in classAbstractMetadataExtractor
- Parameters:
path
- the path of the filecontentStoreService
- the content store servicecontext
- the current context- Returns:
- the extracted metadata
-