Reputation: 259
Basically, I'm trying to do this (incorrect code!):
<camel:setBody>
<camel:simple>resource:classpath:/myfiles/file.xml</camel:simple>
</camel:setBody>
How would you do this properly?
Cheers!
Upvotes: 4
Views: 10415
Reputation: 143
In camel xml dsl you can do this way.
<setBody>
<!--fileName with location to be uploaded -->
<constant>/data/myfiles/file.xml</constant>
</setBody>
<convertBodyTo type="java.io.File"/>
Upvotes: 1
Reputation: 66
In DSL style like this:
.setBody(constant("resource:classpath:foo/bar/baz/some.sql"))
Upvotes: 1
Reputation: 55535
You can possible try with
<to uri="language:constant:resource:classpath:/myfiles/file.xml"/>
To use the language component: http://camel.apache.org/language.html To load the content.
Upvotes: 13