You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by chaij <ji...@indigoarc.com> on 2014/04/03 07:07:53 UTC
read file from classpath
Is possible to read file using Camel from classpath? This file lives in the
bundle.
I have a xml file and want to read it in using file component and then
convert it to Document.
Thanks!
--
View this message in context: http://camel.465427.n5.nabble.com/read-file-from-classpath-tp5749705.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: read file from classpath
Posted by chaij <ji...@indigoarc.com>.
It is in the same bundle.. I was able to do it like this:
<camel:from uri="timer://loadSAMLToken?repeatCount=1" />
<camel:setBody>
<camel:simple>resource:classpath:cms-files/saml.xml</camel:simple>
</camel:setBody>
Thanks!
Jin
--
View this message in context: http://camel.465427.n5.nabble.com/read-file-from-classpath-tp5749705p5749748.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: read file from classpath
Posted by Hadrian Zbarcea <hz...@gmail.com>.
Jin,
Is the file in a different bundle? You have to add your resource bundle as a
dependency.
Hadrian
On Thursday 03 April 2014 01:07:53 chaij wrote:
> Is possible to read file using Camel from classpath? This file lives in the
> bundle.
>
> I have a xml file and want to read it in using file component and then
> convert it to Document.
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/read-file-from-classpath-tp5749705.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: read file from classpath
Posted by Gnanaguru S <gn...@gmail.com>.
Yes. You should be able to !
I think you can use Camel simple and call the file like this
classpath:resource:/path/filename.ext
Give it a shot. But go through simple component first, you will get some
idea.
Cheers
Guru
--
View this message in context: http://camel.465427.n5.nabble.com/read-file-from-classpath-tp5749705p5749711.html
Sent from the Camel - Users mailing list archive at Nabble.com.