karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Marciniszyn <marciniszyn.domi...@gmail.com>
Subject Getting resources from other OSGi Bundle
Date Thu, 22 Jun 2017 09:51:47 GMT
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.

Mime
View raw message