On Tue, Dec 6, 2011 at 4:42 PM, Daniel Gredler
<dgred...@dhlglobalmail.com> wrote:
> Hi all,
>
> I've used the file ant path matching functionality that comes with
> camel-spring [1] five or six times now, and my experience is that while
> the advanced "includes" + "excludes" functionality is good to have, most
> of the time I just need a single include pattern, e.g. "**/*.txt" or
> something along those lines.
>
> When this is the case, and you are using the Java DSL instead of the
> Spring XML to configure Camel, it's very annoying (and bug-prone?) to
> have to define your filter far away from the place that it is used. So I
> made this specific (perhaps common?) use case nicer by implementing a
> String -> GenericFileFilter converter, so that you can say e.g.:
>
> from("file:blah/foo?recursive=true&filter=**/*.txt")
>  .to(...);
>
> Instead of:
>
> from("file:blah/foo?recursive=true&filter=#myRecursiveTxtFilter")
>  .to(...);
>
> In the first example above, the "**/*.txt" filter string gets
> automatically converted into a AntPathMatcherGenericFileFilter where
> includes = "**/*.txt".
>
> The only questionable thing about it is that
> AntPathMatcherGenericFileFilter implements CamelContextAware, so this
> converter also needs to know about the CamelContext so that it can pass
> that information on to AntPathMatcherGenericFileFilter, which it uses
> internally.
>
> So, with that background, does this converter sound like something that
> would be useful in camel-core or camel-spring
> (AntPathMatcherGenericFileFilter is in camel-core, but
> SpringAntPathMatcherFileFilter is in camel-spring)? I can submit it as
> an enhancement via JIRA, but I wasn't sure whether others would find it
> useful or not.
>

As I recall the actual logic is in the Spring JARs, so you are
dependent on camel-spring / Spring modules.
So it would be hard to move such a feature to camel-core.

Alternative is to add java code for the ANT logic in camel-core directly.


> Take care,
>
> Daniel
>
> [1]
> http://camel.apache.org/file2.html#File2-FilteringusingANTpathmatcher



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to