I have to download a file which is in remote location using SFTP on clicking a hyperlink . Am using JBOSS 5.1 as my Server and using struts2. I have implemented the below code and i found out the receiveBody() of the ConsumerTemplate is coming as null ? Can any one please guide me to the above issue ?
Code :
CamelContext ctx = new DefaultCamelContext();
ConsumerTemplate consumer = ctx.createConsumerTemplate();
String camel_ftp_uri = MessageFormat.format(CAMEL_FTP_PATTERN, ftp_mode, ftp_user, ftp_address, ftp_dir, ftp_options);
System.out.println("camel_ftp_uri ::: "+camel_ftp_uri);
Object obj= consumer.receiveBody(camel_ftp_uri);
System.out.println("obj ::"+obj);
when am printing the camel_ftp_uri
am getting :camel_ftp_uri :::
ftp://ccc_uat1@1x.xxx.xx.xxx//from_ccc/file.txt?disconnect=true
I refered the below link in SOF :
How to retrieve a file from a server via SFTP?
Thanks in Advance