Package org.apache.tika.config
Class TikaConfig
java.lang.Object
org.apache.tika.config.TikaConfig
Parse xml config file.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates 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 theParser
implementations available through theservice provider mechanism
in 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 TikaConfig
Provides a default configuration (TikaConfig).protected static CompositeDetector
getDefaultDetector
(MimeTypes types, ServiceLoader loader) protected static CompositeEncodingDetector
protected static CompositeRenderer
getDefaultRenderer
(ServiceLoader loader) Returns the configured detector instance.Returns the configured encoding detector instancestatic int
Returns the configured parser instance.Returns the configured translator instance.static void
mustNotBeEmpty
(String paramName, String paramValue) static void
mustNotBeEmpty
(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:
TikaException
IOException
SAXException
-
TikaConfig
- Throws:
TikaException
IOException
SAXException
-
TikaConfig
- Throws:
TikaException
IOException
SAXException
-
TikaConfig
- Throws:
TikaException
IOException
SAXException
-
TikaConfig
- Throws:
TikaException
IOException
SAXException
-
TikaConfig
- Throws:
TikaException
IOException
SAXException
-
TikaConfig
- Throws:
TikaException
IOException
SAXException
-
TikaConfig
- Throws:
TikaException
IOException
SAXException
-
TikaConfig
- Throws:
TikaException
IOException
SAXException
-
TikaConfig
- Throws:
TikaException
IOException
-
TikaConfig
- Throws:
TikaException
IOException
-
TikaConfig
- Throws:
TikaException
IOException
-
TikaConfig
- Throws:
TikaException
IOException
-
TikaConfig
Creates a Tika configuration from the built-in media type rules and all theParser
implementations available through theservice provider mechanism
in the given class loader.- Parameters:
loader
- the class loader through which parser implementations are loaded, ornull
for 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
Parser
implementations available through theservice provider mechanism
in 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
-
getAutoDetectParserConfig
-