Class BaseAttachmentContentExtractor
java.lang.Object
com.atlassian.confluence.search.v2.extractor.BaseAttachmentContentExtractor
- All Implemented Interfaces:
Extractor2
- Direct Known Subclasses:
LimitedTextContentExtractor
A base template for attachment content extractors to extend.
- Since:
- 7.17
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractFields(Object searchable) Extract fields from the searchable object.protected @NonNull Optional<CharSequence> extractText(SearchableAttachment attachment) protected abstract StringextractText(InputStream is, SearchableAttachment attachment) extractText(Object searchable) Returns a buffer of text that will be appended onto the end of a larger buffer of text that will eventually become the searchable body text.protected abstract booleanshouldExtractFrom(String fileName, String contentType)
-
Constructor Details
-
BaseAttachmentContentExtractor
public BaseAttachmentContentExtractor()
-
-
Method Details
-
extractText
-
extractFields
Description copied from interface:Extractor2Extract fields from the searchable object.- Specified by:
extractFieldsin interfaceExtractor2- Parameters:
searchable- a searchable object- Returns:
- list of fields extracted from the searchable object
-
extractText
Description copied from interface:Extractor2Returns a buffer of text that will be appended onto the end of a larger buffer of text that will eventually become the searchable body text.- Specified by:
extractTextin interfaceExtractor2- Parameters:
searchable- a searchable object- Returns:
- Returns a buffer of text that will be appended onto the end of a larger buffer of text that will eventually become the searchable body text.
-
shouldExtractFrom
-
extractText
- Parameters:
is- a stream containing the attachment contentsattachment- contains useful attachment metadata, e.g. filename- Returns:
- a String with a textual representation of the attachment's contents
-