camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: FTP consumer > ignore existing files: configuration option?
Date Tue, 10 Jan 2012 13:39:23 GMT
On Tue, Jan 10, 2012 at 11:04 AM, Bilgin Ibryam <> wrote:
> Hi Nic
> On 9 January 2012 17:03, iamniche <> 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
> Bilgin
>> --
>> View this message in context:
>> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message