第 349 章 Tika 组件
从 Camel 版本 2.19 开始提供
Tika: 组件提供了使用 Apache Tika 检测和解析文档的功能。此组件使用 Apache Tika 作为底层库来使用文档。
要使用 Tika 组件,Maven 用户需要将以下依赖项添加到其 pom.xml
中:
pom.xml
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-tika</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency>
TIKA 组件仅支持制作者端点。
349.1. 选项
Tika 组件没有选项。
Tika 端点使用 URI 语法进行配置:
tika:operation
使用以下路径和查询参数:
349.1.1. 路径参数(1 参数):
名称 | 描述 | 默认值 | 类型 |
---|---|---|---|
operation | 所需的 Tika Operation. parse 或 detect | TikaOperation |
349.1.2. 查询参数(5 参数):
名称 | 描述 | 默认值 | 类型 |
---|---|---|---|
tikaConfig (producer) | Tika Config | TikaConfig | |
tikaConfigUri (producer) | Tika Config Uri :tika-config.xml 的 URI | 字符串 | |
tikaParseOutputEncoding (producer) | Tika Parse Output Encoding - 用于指定解析输出的字符编码。Defaults to Charset.defaultCharset() . | 字符串 | |
tikaParseOutputFormat (producer) | Tika 输出格式.支持的输出格式.xml: returns Parsed Content as XML. html: returnss Parsed Content as HTML. text: returnss Parsed Content as Text. textMain: 使用 boilerpipe 库自动从网页中提取主内容。 | xml | TikaParseOutputFormat |
同步 (advanced) | 设置是否应严格使用同步处理,或者 Camel 允许使用异步处理(如果受支持)。 | false | 布尔值 |