【问题标题】:Camel File2 filter over directoriesCamel File2过滤目录
【发布时间】:2011-09-20 19:14:02
【问题描述】:

使用 Camel File2,您可以对文件名设置过滤器,例如: from("file://myfiles/dir1/dir11/?recursive=true& include=*.xml")

http://camel.apache.org/file2 如果使用了诸如 include 或 exclude 之类的选项,则只有文件(不是目录)匹配有效的文件名。

我还想过滤文件名,例如: from("file://myfiles/dir1//.xml?recursive=true)

这可能吗?

我看到有一个 AntPathMatcher 类允许这种类型的过滤器:http://fusesource.com/docs/router/2.6/apidoc/org/apache/camel/core/xml/scan/AntPathMatcher.html 但我不知道如何使用它(不使用 Ant)?

【问题讨论】:

    标签: apache-camel


    【解决方案1】:

    Ant 路径匹配器只是一个使用类似于 Ant 的路径样式的匹配器。它在运行时不需要 Ant。

    查看此页面上的示例和文档:http://camel.apache.org/file2 在标题为 - 使用 ANT 路径匹配器进行过滤的部分

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-01-16
      • 1970-01-01
      • 2013-09-16
      • 2015-11-24
      • 2014-03-12
      • 2017-05-09
      • 2013-04-28
      相关资源
      最近更新 更多