Package org.apache.tika.config
Interface ConfigReader
- All Known Implementing Classes:
JacksonConfigReader
public interface ConfigReader
Reads JSON configuration on behalf of tika-core, which has no JSON library of its own.
tika-serialization provides the one implementation: through
META-INF/services on a
classpath, or as a service in OSGi.- Since:
- Apache Tika 4.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigReaderfind()<T> TgetConfig(ParseContext context, String configKey, Class<T> configClass, T defaultConfig) ImplementsParseContextConfig.getConfig(org.apache.tika.parser.ParseContext, java.lang.String, java.lang.Class<T>, T)once the context holds JSON for the key.<T> TreadConfig(String json, Class<T> configClass, boolean trusted) Deserializesjson; untrusted JSON may not set anOperatorOnlyproperty.
-
Method Details
-
readConfig
Deserializesjson; untrusted JSON may not set anOperatorOnlyproperty.- Throws:
Exception
-
getConfig
<T> T getConfig(ParseContext context, String configKey, Class<T> configClass, T defaultConfig) throws IOException ImplementsParseContextConfig.getConfig(org.apache.tika.parser.ParseContext, java.lang.String, java.lang.Class<T>, T)once the context holds JSON for the key.- Throws:
IOException
-
find
- Returns:
- the reader, or null if tika-serialization is absent
- Throws:
IllegalStateException- if more than one reader is available
-