public class TikaConfig extends Object
Constructor and Description |
---|
TikaConfig()
Creates a default Tika configuration.
|
TikaConfig(ClassLoader loader)
Creates a Tika configuration from the built-in media type rules
and all the
Parser implementations available through the
service provider mechanism in the given
class loader. |
TikaConfig(Document document) |
TikaConfig(Element element) |
TikaConfig(Element element,
ClassLoader loader) |
TikaConfig(File file) |
TikaConfig(InputStream stream) |
TikaConfig(String file) |
TikaConfig(URL url) |
TikaConfig(URL url,
ClassLoader loader) |
Modifier and Type | Method and Description |
---|---|
static TikaConfig |
getDefaultConfig()
Provides a default configuration (TikaConfig).
|
protected Detector |
getDefaultDetector(MimeTypes types,
ServiceLoader loader) |
Detector |
getDetector()
Returns the configured detector instance.
|
MediaTypeRegistry |
getMediaTypeRegistry() |
MimeTypes |
getMimeRepository() |
Parser |
getParser()
Returns the configured parser instance.
|
Parser |
getParser(MediaType mimeType)
Deprecated.
Use the
getParser() method instead |
Translator |
getTranslator()
Returns the configured translator instance.
|
public TikaConfig(String file) throws TikaException, IOException, SAXException
TikaException
IOException
SAXException
public TikaConfig(File file) throws TikaException, IOException, SAXException
TikaException
IOException
SAXException
public TikaConfig(URL url) throws TikaException, IOException, SAXException
TikaException
IOException
SAXException
public TikaConfig(URL url, ClassLoader loader) throws TikaException, IOException, SAXException
TikaException
IOException
SAXException
public TikaConfig(InputStream stream) throws TikaException, IOException, SAXException
TikaException
IOException
SAXException
public TikaConfig(Document document) throws TikaException, IOException
TikaException
IOException
public TikaConfig(Element element) throws TikaException, IOException
TikaException
IOException
public TikaConfig(Element element, ClassLoader loader) throws TikaException, IOException
TikaException
IOException
public TikaConfig(ClassLoader loader) throws MimeTypeException, IOException
Parser
implementations available through the
service provider mechanism
in the given
class loader.loader
- the class loader through which parser implementations
are loaded, or null
for no parsersMimeTypeException
- if the built-in media type rules are brokenIOException
- if the built-in media type rules can not be readpublic TikaConfig() throws TikaException, IOException
If one of these have a value, try to resolve it relative to file system or classpath.
If XML config is not specified, initialize from the built-in media
type rules and all the Parser
implementations available through
the service provider mechanism
in the context
class loader of the current thread.
IOException
- if the configuration can not be readTikaException
- if problem with MimeTypes or parsing XML configprotected Detector getDefaultDetector(MimeTypes types, ServiceLoader loader)
public Parser getParser(MediaType mimeType)
getParser()
method insteadpublic Parser getParser()
public Detector getDetector()
public Translator getTranslator()
public MimeTypes getMimeRepository()
public MediaTypeRegistry getMediaTypeRegistry()
public static TikaConfig getDefaultConfig()
Copyright © 2007-2015 The Apache Software Foundation. All Rights Reserved.