karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Nodet <gno...@apache.org>
Subject Re: Getting resources from other OSGi Bundle
Date Fri, 23 Jun 2017 05:58:52 GMT
Note that getResource always return null for fragments ...

2017-06-22 11:51 GMT+02:00 Dominik Marciniszyn <
marciniszyn.dominik@gmail.com>:

> Hi,
>
> I have two osgi bundles and I would like to get some resources files from
> one bundle to another. I've used BundleContext to get the second bundle by
> ID. Then I use getResource() method, pass the path parameter but always got
> null.
>
> Sample code I used:
> BundleContext context =
> FrameworkUtil.getBundle(MyClass.class).getBundleContext();
> context.getBundle(id_of_my_second_bundle).getResource("
> resource/res_file");
>
> Thank you for any advices or help,
> Dominik Marciniszyn
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.
> com/Getting-resources-from-other-OSGi-Bundle-tp4050852.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>



-- 
------------------------
Guillaume Nodet

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message