public abstract class A_CmsTextExtractor extends java.lang.Object implements I_CmsTextExtractor
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
m_inputBuffer
A buffer in case the input stream must be read more then once.
|
| Constructor and Description |
|---|
A_CmsTextExtractor() |
| Modifier and Type | Method and Description |
|---|---|
I_CmsExtractionResult |
extractText(byte[] content)
Extracts the text and meta information from the given binary document.
|
I_CmsExtractionResult |
extractText(byte[] content,
java.lang.String encoding)
Extracts the text and meta information from the given binary document, using the specified content encoding.
|
I_CmsExtractionResult |
extractText(java.io.InputStream in)
Extracts the text and meta information from the document on the input stream.
|
I_CmsExtractionResult |
extractText(java.io.InputStream in,
java.lang.String encoding)
Extracts the text and meta information from the document on the input stream, using the specified content encoding.
|
java.io.InputStream |
getStreamCopy(java.io.InputStream in)
Creates a copy of the original input stream, which allows to read the input stream more then
once, required for certain document types.
|
protected java.lang.String |
removeControlChars(java.lang.String content)
Removes "unwanted" control chars from the given content.
|
protected byte[] m_inputBuffer
public I_CmsExtractionResult extractText(byte[] content) throws java.lang.Exception
I_CmsTextExtractorThe encoding of the input stream is either not required (the document type may have one common default encoding) or the extractor is able to divine the encoding from the provided binary array automatically.
Delivers is the same result as calling
when I_CmsTextExtractor.extractText(byte[], String)String == null.
extractText in interface I_CmsTextExtractorcontent - the binary content of the document to extract the text fromjava.lang.Exception - if the text extration failsorg.opencms.search.extractors.I_CmsTextExtractor#extractText(byte[])public I_CmsExtractionResult extractText(byte[] content, java.lang.String encoding) throws java.lang.Exception
I_CmsTextExtractor
The encoding is a hint for the text extractor, if the value given is null then
the text extractor should try to figure out the encoding itself.
extractText in interface I_CmsTextExtractorcontent - the binary content of the document to extract the text fromencoding - the encoding to usejava.lang.Exception - if the text extration failsorg.opencms.search.extractors.I_CmsTextExtractor#extractText(byte[], java.lang.String)public I_CmsExtractionResult extractText(java.io.InputStream in) throws java.lang.Exception
I_CmsTextExtractorThe encoding of the input stream is either not required (the document type may have one common default encoding) or the extractor is able to divine the encoding from the provided input stream automatically.
Delivers is the same result as calling
when I_CmsTextExtractor.extractText(InputStream, String)String == null.
extractText in interface I_CmsTextExtractorin - the input stream for the document to extract the text fromjava.lang.Exception - if the text extration failsorg.opencms.search.extractors.I_CmsTextExtractor#extractText(java.io.InputStream)public I_CmsExtractionResult extractText(java.io.InputStream in, java.lang.String encoding) throws java.lang.Exception
I_CmsTextExtractor
The encoding is a hint for the text extractor, if the value given is null then
the text extractor should try to figure out the encoding itself.
extractText in interface I_CmsTextExtractorin - the input stream for the document to extract the text fromencoding - the encoding to usejava.lang.Exception - if the text extration failsorg.opencms.search.extractors.I_CmsTextExtractor#extractText(java.io.InputStream, java.lang.String)public java.io.InputStream getStreamCopy(java.io.InputStream in)
throws java.io.IOException
in - the inpur stram to copyjava.io.IOException - in case of read errors from the original input streamprotected java.lang.String removeControlChars(java.lang.String content)
content - the content to remove the unwanted control chars from