camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shing Hing Man <mat...@yahoo.com.INVALID>
Subject Re: How to sftp download latest version of a file
Date Thu, 16 Jul 2015 09:45:04 GMT

Hi Claus,
    Thanks for your suggestion and it works!
  template.receiveBody( "sftp://myuser@sftp.foo.com/valid?preferredAuthentications=publickey&privateKeyFile=/home/foo/myPubKey&sortBy=reverse:file:name&maxMessagesPerPoll=1&eagerMaxMessagesPerPoll=false");
Shing

 


     On Wednesday, 15 July 2015, 18:57, Claus Ibsen <claus.ibsen@gmail.com> wrote:
   

 Hi

You can likely sort the files and then use maxMessagesPerPoll=1 to
limit to 1 file.
And make sure to set eagerMaxMessagesPerPoll=false so you do the sort
before limit.

See details at
http://camel.apache.org/file2

On Wed, Jul 15, 2015 at 7:53 PM, Shing Hing Man
<matmsh@yahoo.com.invalid> wrote:
> Hi,
> In a remote ftp server, there are timestamped copies of  foo-{yyyymmdd-hhmmss}.txt.
>  I would like to stfp download the latest copy.  If I know the file name of the latest
copy is foo-20150715-130120.txt, I can download foo-20150715-130120.txt using :  template.receiveBody(
"sftp://myuser@sftp.foo.com/valid?preferredAuthentications=publickey&privateKeyFile=/home/foo/myPubKey&fileName=foo-20150715-130120.txt");
>  Is there a "Camel" way to download the latest copy of foo-{yyyymmdd-hhmmss}.txt ? (I
do not want to download all copies of foo-{yyyymmdd-hhmmss}.txt, as there might be hundreds
of them.)
>
>  An alternative is to use something like Jsch to determine the latest copy of foo-{yyyymmdd-hhmmss}.txt. 
Thanks in advance for any assistance !
>  Shing



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

  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message