camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: How to consume csv files only in file componant
Date Tue, 12 Mar 2013 09:17:21 GMT
On Tue, Mar 12, 2013 at 9:49 AM, sarfaraj <> wrote:
> Hi,
> I have camel route with
> <from uri="file:src/test_fs?delete=true" />.
> <to uri="file:src/local_fs" />
> Here every files on test_fs got copied to local_fs and original one got
> deleted from test_fs.
> But I want to consume only csv files not the others. (Even  I don't  want to
> delete other files)
> I can use  <choice> <when><simple>${file:ext} == 'csv'</simple>
to process
> only csv files. But the issue is other extension files also got deleted
> because of delete=true in from tag.
> In short i dont want to touch other than csv files in from componant
> Is it possible ? How ?

See the file documentation

There is an include option that uses java reg exp pattern, eg


To include files ending with csv

But there is also an antInclude option that maybe is more readable


And you can also implement a custom filter and use java code to
compute if the file should be included or not.

> /Sarfaraj
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message