Package org.apache.tika.config
Class TikaConfig
java.lang.Object
org.apache.tika.config.TikaConfig
Parse xml config file.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a default Tika configuration.TikaConfig(File file) TikaConfig(File file, ServiceLoader loader) TikaConfig(InputStream stream) TikaConfig(ClassLoader loader) Creates a Tika configuration from the built-in media type rules and all theParserimplementations available through theservice provider mechanismin the given class loader.TikaConfig(String file) TikaConfig(URL url) TikaConfig(URL url, ClassLoader loader) TikaConfig(URL url, ServiceLoader loader) TikaConfig(Path path) TikaConfig(Path path, ServiceLoader loader) TikaConfig(Document document) TikaConfig(Document document, ServiceLoader loader) TikaConfig(Element element) TikaConfig(Element element, ClassLoader loader) -
Method Summary
Modifier and TypeMethodDescriptionstatic TikaConfigProvides a default configuration (TikaConfig).Returns the configured detector instance.Returns the configured encoding detector instanceorg.apache.tika.metadata.filter.MetadataFilterReturns the configured parser instance.Deprecated.Returns the configured translator instance.
-
Constructor Details
-
TikaConfig
- Throws:
TikaExceptionIOExceptionSAXException
-
TikaConfig
- Throws:
TikaExceptionIOExceptionSAXException
-
TikaConfig
- Throws:
TikaExceptionIOExceptionSAXException
-
TikaConfig
- Throws:
TikaExceptionIOExceptionSAXException
-
TikaConfig
- Throws:
TikaExceptionIOExceptionSAXException
-
TikaConfig
- Throws:
TikaExceptionIOExceptionSAXException
-
TikaConfig
- Throws:
TikaExceptionIOExceptionSAXException
-
TikaConfig
- Throws:
TikaExceptionIOExceptionSAXException
-
TikaConfig
- Throws:
TikaExceptionIOExceptionSAXException
-
TikaConfig
- Throws:
TikaExceptionIOException
-
TikaConfig
- Throws:
TikaExceptionIOException
-
TikaConfig
- Throws:
TikaExceptionIOException
-
TikaConfig
- Throws:
TikaExceptionIOException
-
TikaConfig
Creates a Tika configuration from the built-in media type rules and all theParserimplementations available through theservice provider mechanismin the given class loader.- Parameters:
loader- the class loader through which parser implementations are loaded, ornullfor no parsers- Throws:
MimeTypeException- if the built-in media type rules are brokenIOException- if the built-in media type rules can not be read- Since:
- Apache Tika 0.8
-
TikaConfig
Creates a default Tika configuration. First checks whether an XML config file is specified, either in- System property "tika.config", or
- Environment variable TIKA_CONFIG
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
Parserimplementations available through theservice provider mechanismin the context class loader of the current thread.- Throws:
IOException- if the configuration can not be readTikaException- if problem with MimeTypes or parsing XML config
-
-
Method Details
-
getParser
Deprecated.Use thegetParser()method instead -
getParser
Returns the configured parser instance.- Returns:
- configured parser
-
getDetector
Returns the configured detector instance.- Returns:
- configured detector
-
getEncodingDetector
Returns the configured encoding detector instance- Returns:
- configured encoding detector
-
getTranslator
Returns the configured translator instance.- Returns:
- configured translator
-
getExecutorService
-
getMimeRepository
-
getMediaTypeRegistry
-
getServiceLoader
-
getMetadataFilter
public org.apache.tika.metadata.filter.MetadataFilter getMetadataFilter() -
getDefaultConfig
Provides a default configuration (TikaConfig). Currently creates a new instance each time it's called; we may be able to have it return a shared instance once it is completely immutable.- Returns:
- default configuration
-
getParser()method instead