camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" <>
Subject Re: Poll a collection of subfolders with a single endpoint
Date Wed, 17 Dec 2008 19:49:33 GMT

You can use the recursive=true option and Camel will walk all sub
folders. If that is sufficient
<endpoint id="mailboxes" uri="file:/mailboxe/?consumer.recurisve=true"/>

If you need more fine grained control of which folders / files to
consume there are several options
- excludedNamePrefix
- excludedNamePostfix
- consumer.regexPattern

But they only operates on the so you wont have
the path to test from.
I guess that is a limitation sometimes and we could add options for
the File.getPath() so you have both combos
- consumer.pathRegexPattern

But yet again the file component has many options now and it can get a
bit confusing.

I have been considering supporting the ant path style
(**/dropOffFolder), that you have in spring resource.
But I didn't want to write an ant path style parser and camel-core
should not require spring.
But that would be cool

In Camel 2.0 we have support for setting a where
you can do the test in java code, and thus it would be possible.

File language is meant for the file producer to set the filename, so
you can not currently use it for filtering which files/folders should
be included in the file consumer. But I guess we could do filtering
using expressions, but we dont have nice support for this in the DSL
as from is generic.

Any thoughts?

On Wed, Dec 17, 2008 at 7:44 PM, ychawla <> wrote:
> Hello All,
> I have a well defined file structure where I am going to be picking up files
> from.  It looks like this:
> Mailboxes (STATIC)
>      Mailbox1 (dynamic)
>          dropOffFolder (static)
>      Mailbox2 (dynamic)
>          dropOffFolder (static)
> Currently I have endpoints defined like this:
> <endpoint id="mailbox1" uri="file:/mailboxes/Mailbox1/dropOffFolder"/>
> <endpoint id="mailbox1" uri="file:/mailboxes/Mailbox2/dropOffFolder"/>
> Would it be possible through File Language, simple or another mechanism to
> have a single endpoint with * being a wilcard:
> <endpoint id="mailboxes" uri="file:/mailboxes/*/dropOffFolder"/>
> I checked the documentation and I couldn't find anything.
> Thanks!
> Yogesh
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at


/Claus Ibsen
Apache Camel Committer

View raw message