Package com.funnelback.filter.api
Interface FilterDocumentFactory
-
public interface FilterDocumentFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BytesDocument
toBytesDocument(FilterableDocument filterableDocument)
Converts a FilterableDocument into a RawFilterableDocumentOptional<StringDocument>
toStringDocument(FilterableDocument filterableDocument)
Attempts to create a StingDocument from the given document.StringDocument
toStringDocument(FilterableDocument filterableDocument, DocumentType documentType, String content)
Constructs a StringDocument from a FilterableDocument, with the given mimeType and content.
-
-
-
Method Detail
-
toBytesDocument
BytesDocument toBytesDocument(FilterableDocument filterableDocument)
Converts a FilterableDocument into a RawFilterableDocument- Parameters:
filterableDocument
- used to construct the ByteDocument.- Returns:
- a ByteDocument constructed from the given document.
-
toStringDocument
Optional<StringDocument> toStringDocument(FilterableDocument filterableDocument)
Attempts to create a StingDocument from the given document.Makes a clone of the given document and converts the document content to a String. This will use the charset of the document if set otherwise it will guess the charset. If the charset could not be guessed or an error occurs while converting the content to a String then an optional empty is returned.
- Parameters:
filterableDocument
- the document to make a StringDocument from.- Returns:
- A StringDocument copy of the given document or empty if a string document could not be created.
-
toStringDocument
StringDocument toStringDocument(FilterableDocument filterableDocument, DocumentType documentType, String content)
Constructs a StringDocument from a FilterableDocument, with the given mimeType and content.This may be used when converting from binary to a string form, such as pdf to html.
- Parameters:
filterableDocument
- which the resulting document will be cloned from.documentType
- of the given content.content
- the new content of the document as a String.- Returns:
- A StringDocument which is the same as the given filterableDocument except with the given documentType and content.
-
-