You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mdo <ma...@gmail.com> on 2013/05/02 12:58:32 UTC

File2: only move non-filtered

Hello,

I have a directory structure where I want to selectively process files while
leaving the filtered ones untouched. My route:

        from("file:///.../somedir?recursive=true&move=.done")
        .filter().simple("${file:onlyname} regex '.*[.]txt'")
        .process(new MyProcessor())
        .to(...);

So only files ending with a .txt-suffix should get processed which does
work. But Camel shall leave the remaining files at their source position.
How can I prevent Camel from moving them to .done?

Regards, mdo.





--
View this message in context: http://camel.465427.n5.nabble.com/File2-only-move-non-filtered-tp5731908.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File2: only move non-filtered

Posted by mdo <ma...@gmail.com>.
Thank you Claus!

Just to add it to this thread: I now use the "include" option of file2 with
my regex.



--
View this message in context: http://camel.465427.n5.nabble.com/File2-only-move-non-filtered-tp5731908p5731913.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File2: only move non-filtered

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You need to use the filter option(s) on the file endpoint to skip those files
http://camel.apache.org/file2

There is options like: include, exclude, antInclude, antExclude, filter, etc.

There is details on that link.


On Thu, May 2, 2013 at 12:58 PM, mdo <ma...@gmail.com> wrote:
> Hello,
>
> I have a directory structure where I want to selectively process files while
> leaving the filtered ones untouched. My route:
>
>         from("file:///.../somedir?recursive=true&move=.done")
>         .filter().simple("${file:onlyname} regex '.*[.]txt'")
>         .process(new MyProcessor())
>         .to(...);
>
> So only files ending with a .txt-suffix should get processed which does
> work. But Camel shall leave the remaining files at their source position.
> How can I prevent Camel from moving them to .done?
>
> Regards, mdo.
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/File2-only-move-non-filtered-tp5731908.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen