You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by morio <js...@oreilly.com> on 2014/03/24 21:17:50 UTC

bean generates filename as body, need to send file over ftp

I'm very new to camel.
I've written a bean that creates a file, now I need to send the file over
ftp.
My current thought is to return the filename as the body of the message, but
scouring the documentation and example code it seems that this is never
done.

I'd like the route to look like this
.start("start-from-quartz")
  .to("bean:createfile?method=execute")
  .to("ftp:server/location/destination_filename")
.end();

How can I pass the location file location from my bean to the ftp transfer?

Notes:
Camel version: 2.4.0
Spring version: 3.0.3
Jave version: 1.6

Thank you,
-Morio



--
View this message in context: http://camel.465427.n5.nabble.com/bean-generates-filename-as-body-need-to-send-file-over-ftp-tp5749293.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: bean generates filename as body, need to send file over ftp

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You need to set a header with the file name. So you can maybe have a
2nd method on the bean that creates the file name you want to use.

The header key is Exchange.FILE_NAME

from X
to bean
.setHeander(Exchange.FILE_NAME, bean("createFile", "createFileName"))
to ftp

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

On Mon, Mar 24, 2014 at 9:17 PM, morio <js...@oreilly.com> wrote:
> I'm very new to camel.
> I've written a bean that creates a file, now I need to send the file over
> ftp.
> My current thought is to return the filename as the body of the message, but
> scouring the documentation and example code it seems that this is never
> done.
>
> I'd like the route to look like this
> .start("start-from-quartz")
>   .to("bean:createfile?method=execute")
>   .to("ftp:server/location/destination_filename")
> .end();
>
> How can I pass the location file location from my bean to the ftp transfer?
>
> Notes:
> Camel version: 2.4.0
> Spring version: 3.0.3
> Jave version: 1.6
>
> Thank you,
> -Morio
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/bean-generates-filename-as-body-need-to-send-file-over-ftp-tp5749293.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io