Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to access a resource from a jar-file?(What's the right way to access a resource from a jar-file attached to plugins classpath?)
How to access a resource from a jar-file? [message #741498] Wed, 19 October 2011 15:34
Geronimo M.H. is currently offline Geronimo M.H.Friend
Messages: 7
Registered: October 2011
Junior Member

may be I missed something.
I'd like to load a resource from a jarfile, that's attached to a plugins classpath (in manifest).

I tried to overload a Classloader at plugins activator, where I use FileLocator.findEntries(...)

At activation time, I've no idea about how to access the classpath entries from plugins manifest.
When I step down the FileLocator.findEntries(...), I hit BaseData.getEntry(...), where the classpath entries from manifest are resolved.
... but ...
if I got things right, getBundleFile().getEntry(...) resolves files from plugin only, without taking a look at the libraries from classpath.

So without starting to parse the manifest by myself, I think the right point for a patch would be BaseData.getEntry(...) - adding a URL-Classloader for all libraries of the classpath, which then would return the right resource.

... but I don't really like that kindof hakking ...
Is there another way to solve the problem without having to modify eclipse runtime?

Any hint is appreciated.

regards Gero
Previous Topic:Build fails on my Indigo but succeeds on my friends Indigo
Next Topic:How can I add an AdminPermission to my plugin?
Goto Forum:

Current Time: Tue Jun 28 01:10:59 GMT 2022

Powered by FUDForum. Page generated in 0.02009 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top