public class TikaConfig
extends java.lang.Object
Constructor and Description |
---|
TikaConfig()
Creates a default Tika configuration.
|
TikaConfig(java.lang.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(org.w3c.dom.Document document) |
TikaConfig(org.w3c.dom.Document document,
ServiceLoader loader) |
TikaConfig(org.w3c.dom.Element element) |
TikaConfig(org.w3c.dom.Element element,
java.lang.ClassLoader loader) |
TikaConfig(java.io.File file) |
TikaConfig(java.io.File file,
ServiceLoader loader) |
TikaConfig(java.io.InputStream stream) |
TikaConfig(java.nio.file.Path path) |
TikaConfig(java.nio.file.Path path,
ServiceLoader loader) |
TikaConfig(java.lang.String file) |
TikaConfig(java.net.URL url) |
TikaConfig(java.net.URL url,
java.lang.ClassLoader loader) |
TikaConfig(java.net.URL url,
ServiceLoader loader) |
Modifier and Type | Method and Description |
---|---|
static TikaConfig |
getDefaultConfig()
Provides a default configuration (TikaConfig).
|
Detector |
getDetector()
Returns the configured detector instance.
|
EncodingDetector |
getEncodingDetector()
Returns the configured encoding detector instance
|
java.util.concurrent.ExecutorService |
getExecutorService() |
MediaTypeRegistry |
getMediaTypeRegistry() |
MimeTypes |
getMimeRepository() |
Parser |
getParser()
Returns the configured parser instance.
|
Parser |
getParser(MediaType mimeType)
Deprecated.
Use the
getParser() method instead |
ServiceLoader |
getServiceLoader() |
Translator |
getTranslator()
Returns the configured translator instance.
|
public TikaConfig(java.lang.String file) throws TikaException, java.io.IOException, org.xml.sax.SAXException
TikaException
java.io.IOException
org.xml.sax.SAXException
public TikaConfig(java.nio.file.Path path) throws TikaException, java.io.IOException, org.xml.sax.SAXException
TikaException
java.io.IOException
org.xml.sax.SAXException
public TikaConfig(java.nio.file.Path path, ServiceLoader loader) throws TikaException, java.io.IOException, org.xml.sax.SAXException
TikaException
java.io.IOException
org.xml.sax.SAXException
public TikaConfig(java.io.File file) throws TikaException, java.io.IOException, org.xml.sax.SAXException
TikaException
java.io.IOException
org.xml.sax.SAXException
public TikaConfig(java.io.File file, ServiceLoader loader) throws TikaException, java.io.IOException, org.xml.sax.SAXException
TikaException
java.io.IOException
org.xml.sax.SAXException
public TikaConfig(java.net.URL url) throws TikaException, java.io.IOException, org.xml.sax.SAXException
TikaException
java.io.IOException
org.xml.sax.SAXException
public TikaConfig(java.net.URL url, java.lang.ClassLoader loader) throws TikaException, java.io.IOException, org.xml.sax.SAXException
TikaException
java.io.IOException
org.xml.sax.SAXException
public TikaConfig(java.net.URL url, ServiceLoader loader) throws TikaException, java.io.IOException, org.xml.sax.SAXException
TikaException
java.io.IOException
org.xml.sax.SAXException
public TikaConfig(java.io.InputStream stream) throws TikaException, java.io.IOException, org.xml.sax.SAXException
TikaException
java.io.IOException
org.xml.sax.SAXException
public TikaConfig(org.w3c.dom.Document document) throws TikaException, java.io.IOException
TikaException
java.io.IOException
public TikaConfig(org.w3c.dom.Document document, ServiceLoader loader) throws TikaException, java.io.IOException
TikaException
java.io.IOException
public TikaConfig(org.w3c.dom.Element element) throws TikaException, java.io.IOException
TikaException
java.io.IOException
public TikaConfig(org.w3c.dom.Element element, java.lang.ClassLoader loader) throws TikaException, java.io.IOException
TikaException
java.io.IOException
public TikaConfig(java.lang.ClassLoader loader) throws MimeTypeException, java.io.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 brokenjava.io.IOException
- if the built-in media type rules can not be readpublic TikaConfig() throws TikaException, java.io.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.
java.io.IOException
- if the configuration can not be readTikaException
- if problem with MimeTypes or parsing XML configpublic Parser getParser(MediaType mimeType)
getParser()
method insteadpublic Parser getParser()
public Detector getDetector()
public EncodingDetector getEncodingDetector()
public Translator getTranslator()
public java.util.concurrent.ExecutorService getExecutorService()
public MimeTypes getMimeRepository()
public MediaTypeRegistry getMediaTypeRegistry()
public ServiceLoader getServiceLoader()
public static TikaConfig getDefaultConfig()
Copyright © 2010 - 2020 Adobe. All Rights Reserved