Package org.apache.tika.extractor
Class DefaultEmbeddedStreamTranslator
java.lang.Object
org.apache.tika.extractor.DefaultEmbeddedStreamTranslator
- All Implemented Interfaces:
EmbeddedStreamTranslator
Loads EmbeddedStreamTranslators via service loading. Tries to run each
in turn. If a translator accepts the stream, it will do the translation but not close the stream.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldTranslate(TikaInputStream inputStream, Metadata metadata) This should sniff the stream to determine if it needs to be translated.voidtranslate(TikaInputStream inputStream, Metadata metadata, OutputStream outputStream) This will consume the InputStream and write the stream to the output stream
-
Constructor Details
-
DefaultEmbeddedStreamTranslator
public DefaultEmbeddedStreamTranslator()
-
-
Method Details
-
shouldTranslate
This should sniff the stream to determine if it needs to be translated. The translator is responsible for resetting the stream if any bytes have been read.- Specified by:
shouldTranslatein interfaceEmbeddedStreamTranslator- Parameters:
inputStream-metadata-- Returns:
- Throws:
IOException
-
translate
public void translate(TikaInputStream inputStream, Metadata metadata, OutputStream outputStream) throws IOException This will consume the InputStream and write the stream to the output stream- Specified by:
translatein interfaceEmbeddedStreamTranslator- Parameters:
inputStream-metadata-outputStream- to write to- Throws:
IOException
-