I have a jar embedded in a bundle that needs to fetch a resource packaged with it like so:
MyBundle
-\\ src
-\\lib
-\\MyEmbeddedJar
-\\src
I'm going to accept @Angelo's solution as it gave me the idea on how to work around this, though, I'd like to add more information in - thus my answer.
My work around was to add another constructor to SomeClass
that takes in a java.net.URL
instance. I also copied someResource.xml
into the bundle's root.
I then updated the instantiation of SomeClass
in the bundle like so:
new SomeClass( FileLocator.find( Activator.getDefault().getBundle(), new Path( "./someResource.xml" ), new HashMap< String, String >() ) );
This seems like a pretty big hack to me. What if I could not edit the contents of SomeClass
? I guess I would have to unpack it or I'd be forced to wrap it into it's own bundle?