You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mdo <ma...@gmail.com> on 2013/04/22 11:18:25 UTC

FTP2: SFTP and target file paths

Hello,

Camel (2.11) consuming remote files via SFTP, e.g.:

from: sftp://localhost//home/user/
to: file://tmp/

... for a source file "dir1/file1" creates the target file
/tmp/home/user/dir1/file1. Can I somehow omit the source starting path
(/home/user). The file component obviously behaves differently, it only uses
the relative part on the target. The desired outcome is /tmp/dir1/file1.

Thanks.
mdo





--
View this message in context: http://camel.465427.n5.nabble.com/FTP2-SFTP-and-target-file-paths-tp5731220.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: FTP2: SFTP and target file paths

Posted by Chris Wolf <cw...@gmail.com>.
You should be able to do something like this:

to("file://tmp/${file:onlyname}");

See:  http://camel.apache.org/file-language.html



On Mon, Apr 22, 2013 at 10:24 AM, mdo <ma...@gmail.com> wrote:
> mdo wrote
>> from: sftp://localhost//home/user/
>> to: file://tmp/
>
> exchange.in.headers has the header "CamelFileName" where an SFTP consumed
> file has the complete path including the endpoint path whereas a file that
> comes from a FILE endpoint only has the relative path.
>
> When I insert this statement into my route I can fix this:
> .setHeader("CamelFileName",header("CamelFileRelativePath"))
>
> Is this meant to be that way?
>
> Regards, mdo.
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/FTP2-SFTP-and-target-file-paths-tp5731220p5731265.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: FTP2: SFTP and target file paths

Posted by mdo <ma...@gmail.com>.
mdo wrote
> from: sftp://localhost//home/user/
> to: file://tmp/

exchange.in.headers has the header "CamelFileName" where an SFTP consumed
file has the complete path including the endpoint path whereas a file that
comes from a FILE endpoint only has the relative path.

When I insert this statement into my route I can fix this:
.setHeader("CamelFileName",header("CamelFileRelativePath"))

Is this meant to be that way?

Regards, mdo.





--
View this message in context: http://camel.465427.n5.nabble.com/FTP2-SFTP-and-target-file-paths-tp5731220p5731265.html
Sent from the Camel - Users mailing list archive at Nabble.com.