Package org.apache.tika.config
Class TikaConfig
java.lang.Object
org.apache.tika.config.TikaConfig
Parse xml config file.
-
Field Summary
Fields -
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).protected static CompositeDetectorgetDefaultDetector(MimeTypes types, ServiceLoader loader) protected static CompositeEncodingDetectorprotected static CompositeRenderergetDefaultRenderer(ServiceLoader loader) Returns the configured detector instance.Returns the configured encoding detector instancestatic intReturns the configured parser instance.Returns the configured translator instance.static voidmustNotBeEmpty(String paramName, String paramValue) static voidmustNotBeEmpty(String paramName, Path paramValue)
-
Field Details
-
DEFAULT_MAX_JSON_STRING_FIELD_LENGTH
public static int DEFAULT_MAX_JSON_STRING_FIELD_LENGTH -
MAX_JSON_STRING_FIELD_LENGTH_ELEMENT_NAME
-
TIMES_INSTANTIATED
-
-
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
-
getMaxJsonStringFieldLength
public static int getMaxJsonStringFieldLength()- Returns:
- maximum field length when serializing String fields in Tika's metadata or metadata list into JSON
-
getDefaultDetector
-
getDefaultEncodingDetector
-
getDefaultRenderer
-
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
-
mustNotBeEmpty
- Throws:
TikaConfigException
-
mustNotBeEmpty
- Throws:
TikaConfigException
-
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
-
getMetadataListFilter
-
getAutoDetectParserConfig
-