camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Use a file as input to unit tests
Date Sun, 04 Nov 2012 07:36:41 GMT
On Sat, Nov 3, 2012 at 5:45 PM, Babak Vahdat
<babak.vahdat@swissonline.ch> wrote:
> Hi
>
> Do you mean:
>
> template.sendBody("direct:create",
> context.getTypeConverter().convertTo(String.class, new
> File("src/data/someXmlFile.xml")));
>
> Babak
>

You may also just send the java.io.File as body. As often the type
conversion will kick in and load the content using a FileInputStream
out of the box, when needed. Though you can also as Babak has shown
cover the file to a String beforehand.


>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Use-a-file-as-input-to-unit-tests-tp5722069p5722079.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message