Re: FTP consumer ignore existing files: configuration option?

2012-01-10 Thread Bilgin Ibryam
Hi Nic

On 9 January 2012 17:03, iamniche nhem...@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.


Re: FTP consumer ignore existing files: configuration option?

2012-01-10 Thread Claus Ibsen
On Tue, Jan 10, 2012 at 11:04 AM, Bilgin Ibryam bibr...@gmail.com wrote:
 Hi Nic

 On 9 January 2012 17:03, iamniche nhem...@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: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


FTP consumer ignore existing files: configuration option?

2012-01-09 Thread iamniche
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.