On Sat, Nov 3, 2012 at 5:45 PM, Babak Vahdat <[email protected]> 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: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
