You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by iamniche <nh...@scottlogic.co.uk> on 2012/01/09 18:03:51 UTC

FTP consumer > ignore existing files: configuration option?

Hello,

I am using Camel successfully in my project, but have a question concerning
the FTP consumer, specifically, with regard to existing files in a watched
remote folder.

Is there any way of ignoring all files that 'pre-exist' on the server,
hopefully, through configuration on the route i.e. ignoreExisting=true or
similar?

I am only interested in *new* files that get added to the remote folder, not
files that already exist when the route is created via the camel context.

Many thanks for any pointers (maybe I have missed an obvious config param)

Cheerio,
Nic

--
View this message in context: http://camel.465427.n5.nabble.com/FTP-consumer-ignore-existing-files-configuration-option-tp5131747p5131747.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: FTP consumer > ignore existing files: configuration option?

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 10, 2012 at 11:04 AM, Bilgin Ibryam <bi...@gmail.com> wrote:
> Hi Nic
>
> On 9 January 2012 17:03, iamniche <nh...@scottlogic.co.uk> wrote:
>> Hello,
>>
>> I am using Camel successfully in my project, but have a question concerning
>> the FTP consumer, specifically, with regard to existing files in a watched
>> remote folder.
>>
>> Is there any way of ignoring all files that 'pre-exist' on the server,
>> hopefully, through configuration on the route i.e. ignoreExisting=true or
>> similar?
>>
>> I am only interested in *new* files that get added to the remote folder, not
>> files that already exist when the route is created via the camel context.
>
> The only solution I'm guessing about is to use a filter with
> GenericFileFilter and there implement your logic. Getting file
> creation time in java is tricky, but last modified date also might be
> enough.
>

Yeah a custom filter should do the trick. However the timestamp from
the FTP library may not include seconds or so. I think I have seen it
report back only hours:minutes and then 00 for the seconds. I suggest
to just double check whether that apply in your case.

You may also have to consider whether you need to persist that "last
timestamp" detail, in case the Camel app is restarted or something.
Then you may need to "catch up" with files which was in the mean time
added to the FTP server.


>>
>> Many thanks for any pointers (maybe I have missed an obvious config param)
>>
>> Cheerio,
>> Nic
>
> HTH
> Bilgin
>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/FTP-consumer-ignore-existing-files-configuration-option-tp5131747p5131747.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: FTP consumer > ignore existing files: configuration option?

Posted by Bilgin Ibryam <bi...@gmail.com>.
Hi Nic

On 9 January 2012 17:03, iamniche <nh...@scottlogic.co.uk> wrote:
> Hello,
>
> I am using Camel successfully in my project, but have a question concerning
> the FTP consumer, specifically, with regard to existing files in a watched
> remote folder.
>
> Is there any way of ignoring all files that 'pre-exist' on the server,
> hopefully, through configuration on the route i.e. ignoreExisting=true or
> similar?
>
> I am only interested in *new* files that get added to the remote folder, not
> files that already exist when the route is created via the camel context.

The only solution I'm guessing about is to use a filter with
GenericFileFilter and there implement your logic. Getting file
creation time in java is tricky, but last modified date also might be
enough.

>
> Many thanks for any pointers (maybe I have missed an obvious config param)
>
> Cheerio,
> Nic

HTH
Bilgin

>
> --
> View this message in context: http://camel.465427.n5.nabble.com/FTP-consumer-ignore-existing-files-configuration-option-tp5131747p5131747.html
> Sent from the Camel - Users mailing list archive at Nabble.com.