You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Filippo Balicchia <fb...@gmail.com> on 2011/05/22 12:39:21 UTC

how to use getResourceAsStream

Hello, i need to read a resource from a camel osgi bundle.

Usually i use context.getClass().getResourceAsStream("myfile");


But when i run it in a bundle it returns null.
In my pom.xml i write that my

<resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
  </resources>

What can i do to find my file ?

cheers

--f

Re: how to use getResourceAsStream

Posted by Cristiano GaviĆ£o <cv...@gmail.com>.
Hi,

I read this interesting article that talk about getResourceAsStream() 
today and may help you too:

http://www.eclipsezone.com/eclipse/forums/t101557.html

cheers

On 22/05/11 07:39, Filippo Balicchia wrote:
> Hello, i need to read a resource from a camel osgi bundle.
>
> Usually i use context.getClass().getResourceAsStream("myfile");
>
>
> But when i run it in a bundle it returns null.
> In my pom.xml i write that my
>
> <resources>
>        <resource>
>          <directory>src/main/resources</directory>
>        </resource>
>    </resources>
>
> What can i do to find my file ?
>
> cheers
>
> --f