Ad

Camel File2 Filter Over Directories

- 1 answer

With Camel File2 you can set a filter over filenames, for instance: from("file://myfiles/dir1/dir11/?recursive=true& include=*.xml")

http://camel.apache.org/file2 Only files (not directories) are matched for valid filename, if options such as: include or exclude are used.

I'd like to filter also over filenames, something like: from("file://myfiles/dir1//.xml?recursive=true)

is this possible?

I see that there is an AntPathMatcher class that allows this type of filter: http://fusesource.com/docs/router/2.6/apidoc/org/apache/camel/core/xml/scan/AntPathMatcher.html but I don't see how to use it (without using Ant)?

Ad

Answer

The Ant path matcher is just a matcher using Ant like path styles. It does not require Ant at runtime.

See examples and documentation on this page: http://camel.apache.org/file2 at the section titled - Filtering using ANT path matcher

Ad
source: stackoverflow.com
Ad