You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by khurram <c....@gmail.com> on 2014/10/23 14:26:10 UTC

SFTP - LogIn once then change directories to download files

Hi All

I'm new to camel SFTP, requirement is to download 80+ files from a SFTP
host.  

My current design is:

   1- pick up a message for the file name from Oracle AQ
   2- get host, host username/password, host directory and file name from DB
config table for the file
   3- build SFTP URI with the info retreived in step 2
   4- start a route with SFTP URI built in step 3 which looks like this
 
sftp://test@xxx.xx.xxxx.xxx:22/TEST?fileName=TEST_sftp_download_file.csv&maximumReconnectAttempts=0&password=******&stepwise=false&throwExceptionOnConnectFailed=true
  5- I can successfully download a file.

I've to do this for each file!!! rather than reconnecting for each file, I
would like to 

  - connect to the SFTP host without passing in a fileName, for example
sftp://test@xxx.xx.xxxx.xxx:22?maximumReconnectAttempts=0&password=******&stepwise=false&throwExceptionOnConnectFailed=true
  - once connected, CD into a directory
  - list the files to choose the one I want to download

I've tried to get an instance of the SftpOperations with no success.

using Camel version 2.10.2

Any help would be appreciated

Thanks




--
View this message in context: http://camel.465427.n5.nabble.com/SFTP-LogIn-once-then-change-directories-to-download-files-tp5757940.html
Sent from the Camel - Users mailing list archive at Nabble.com.