public class TikaTextExtractor extends Object implements MediaTypeTextExtractor
Constructor and Description |
---|
TikaTextExtractor()
Construct an instance using the default
Tika configuration. |
TikaTextExtractor(String tikaConfigPath)
Construct an instance using a custom tika-config.xml configuration file.
|
public TikaTextExtractor()
Tika
configuration.public TikaTextExtractor(String tikaConfigPath)
tikaConfigPath
- the path to the tika-config.xml configuration file.public boolean supports(javax.ws.rs.core.MediaType mediaType)
MediaType
is supported by this extractor.supports
in interface MediaTypeTextExtractor
mediaType
- to be checked.true
if the provided MediaType
as input is supported.public String extract(byte[] bytes) throws UnsupportedMediaTypeException
extract
in interface MediaTypeTextExtractor
bytes
- an array of byte
representing the input.String
with the extracted text.UnsupportedMediaTypeException
- if the input implicit Media type is not supported.Copyright © 2014 The Apache Software Foundation. All Rights Reserved.