Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How load a resource file from a jar in different plugins?
How load a resource file from a jar in different plugins? [message #449489] Mon, 15 May 2006 06:20 Go to next message
Eclipse UserFriend
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 #449491 is a reply to message #449489] Mon, 15 May 2006 06:43 Go to previous messageGo to next message
Eclipse UserFriend
Have you seen this thread "Library plugin - config files"
also see the link http://www.eclipsezone.com/articles/eclipse-vms/

HTH

Guillaume Helle wrote:
> 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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:couln't launch my product with created launch configuration
Next Topic:Same view size across multiple perspectives
Goto Forum:
  


Current Time: Sat Aug 30 19:40:57 EDT 2025

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

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

Back to the top