You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by grimfury <ti...@gmail.com> on 2014/08/22 08:38:21 UTC

Camel Filter appears to delete files instead of leaving them be.

Hi all,
This task seems so easy and yet I can't get it done.

The task is to look through the files in a directory and compress some which
are older than a certain date, and leave the others untouched.

I've attached all the code needed to run the test.
The compression occurs but it deletes the other files that do have to be
compressed.

If I move the files to a different directory, it works ok - BUT I don't want
to have to do that.

Appreciate any help on this.



My filter class is shown here:


And here is my spring-camel context xml



I'm also attaching here my JUnit test so that it's easy to run





--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Filter-appears-to-delete-files-instead-of-leaving-them-be-tp5755540.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Filter appears to delete files instead of leaving them be.

Posted by grimfury <ti...@gmail.com>.
Thanks Claus.

I tried with putting noop=true 
like this



As stated, the files did not delete - which is great.  
Unfortunately however, the non-gzipped file also did not delete.

But we've found a working solution now, after looking at that file2
documentation:
Implement GenericFileFilter and include it on the uri



Thanks a lot everyone.

Be good see any other solution too...





--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Filter-appears-to-delete-files-instead-of-leaving-them-be-tp5755540p5755549.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Filter appears to delete files instead of leaving them be.

Posted by Claus Ibsen <cl...@gmail.com>.
Use the noop=true to leave the file untouched. Camel moves the file to
.camel by default. Check the file documentation
http://camel.apache.org/file2

On Fri, Aug 22, 2014 at 8:38 AM, grimfury <ti...@gmail.com> wrote:
> Hi all,
> This task seems so easy and yet I can't get it done.
>
> The task is to look through the files in a directory and compress some which
> are older than a certain date, and leave the others untouched.
>
> I've attached all the code needed to run the test.
> The compression occurs but it deletes the other files that do have to be
> compressed.
>
> If I move the files to a different directory, it works ok - BUT I don't want
> to have to do that.
>
> Appreciate any help on this.
>
>
>
> My filter class is shown here:
>
>
> And here is my spring-camel context xml
>
>
>
> I'm also attaching here my JUnit test so that it's easy to run
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Filter-appears-to-delete-files-instead-of-leaving-them-be-tp5755540.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/