How load a resource file from a jar in different plugins? [message #449489] |
Mon, 15 May 2006 06:20  |
Eclipse User |
|
|
|
Originally posted by: guillaume.helle.capgemini.com
Hello,
i have a RCP application with differents plugins.
I have put all my external jars in a "library" plugin, so these externals
jar can be used by the others plugin.
Some of these jar files contains configuration file and i want have access
to these files form the other plugin...
How i can do that?
I have tried :
MyClassInMyJar.class.getResource("TheFileInMyJar")
but it's not work...
How do I load a resource (property file, image etc) in my RCP app where -
>> The resource is in a jar file
>> This jar file is in a plugin library
>> This jar file is in the plugin runtime library path defined in
plugin.xml of the plugin library
Thanks in advance
Guillaume Helle
|
|
|
|
Re: How load a resource file from a jar in different plugins? [message #449737 is a reply to message #449489] |
Thu, 18 May 2006 11:43  |
Eclipse User |
|
|
|
Rather than having one 'library' plugin, import them all as individual bundles. That way, you can do Bundle.getEntry() to load the files.
(Also, it's more efficient; if you have jars-within-plugins and ship them as packed plugins, then they'll be extracted to a temp location in order to load/start the plugin, which will delay load time.)
Alex.
|
|
|
Powered by
FUDForum. Page generated in 0.03030 seconds