You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by gonzo <ma...@jwojciechowski.pl> on 2016/08/13 21:56:42 UTC

ftp advanced filtering

Hello,

I need to add some database checks into my filter. Having file name is not
enough for my case.
I'm wondering if there is any other option of file filtering than using
GenericFileFilter in uri?
Example:
from("ftp://user@host/Downloads?password=password&delete=true&filter=#myFileFilter")
('delete=true' is added on purpose. By default I need files to be deleted.)

1. May I add any argument to '#myFileFilter(userId)' in uri?
2. Can I use '.process()' and '.stop()' combination to prevent some files
from deleting?
3. Can '.filter(new Predicate() ...)' be used in ftp route?

Regards,
Jared



--
View this message in context: http://camel.465427.n5.nabble.com/ftp-advanced-filtering-tp5786379.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ftp advanced filtering

Posted by Claus Ibsen <cl...@gmail.com>.
On Sat, Aug 13, 2016 at 11:56 PM, gonzo <ma...@jwojciechowski.pl> wrote:
> Hello,
>
> I need to add some database checks into my filter. Having file name is not
> enough for my case.
> I'm wondering if there is any other option of file filtering than using
> GenericFileFilter in uri?
> Example:
> from("ftp://user@host/Downloads?password=password&delete=true&filter=#myFileFilter")
> ('delete=true' is added on purpose. By default I need files to be deleted.)
>
> 1. May I add any argument to '#myFileFilter(userId)' in uri?

No

But the implementation of the filter, is just a java class so you can
create that instance anyhow you want and configure it.


> 2. Can I use '.process()' and '.stop()' combination to prevent some files
> from deleting?

No

> 3. Can '.filter(new Predicate() ...)' be used in ftp route?
>

Yes but the file is downloaded from FTP and then filtered afterwards
in the Camel route, and if you have delete=true the file is also
deleted regardless of that filter.


> Regards,
> Jared
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/ftp-advanced-filtering-tp5786379.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2