On Tue, Jan 12, 2010 at 10:54 PM, ronP12 <[email protected]> wrote:
>
> Hello,
>  I  have a SFTP route that takes a JMS message as input.  In the message,
> there is a property that states where the local file is that needs to be
> transferred.  I unmarshal the object and use the property (fileLocation) in
> the exchange  In my code I do something like this:
>
> File transferFile = new File(fileLocation);
> GenericFile gf = new GenericFile();
> gf.setBody(IOConverter.toInputStream(transferFile));
>
> exchange.getIn().setBody(gf);
>
> This will sftp a few files, but, then starts throwing the exception stating
> it cannot find a temp file with a name like
> /tmp/camel-tmp-123456/cos000111222.  Why is it using this tmp file and how
> do I get around this?
>

See the section _Consuming a remote FTP server triggered by a route_
on this wiki page:
http://camel.apache.org/ftp.html
which is based on Camel 1.x but the example is nearly the same.

Basically you should set the filename you want to consume using the
fileName option on the FTP consumer
http://camel.apache.org/file2.html

Note: the FTP2 component shares the options that exists in the file2
component, and hence the fileName option.


> Thanks!
> --
> View this message in context: 
> http://old.nabble.com/RuntimeCamelException-during-Sftp-tp27135447p27135447.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to