Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Bundle Location in RCP
Bundle Location in RCP [message #334226] Tue, 27 January 2009 08:20 Go to next message
Eclipse UserFriend
Hello,

I have a requirement to get the bundle location.


In the Activator.start() method, I used the statement -
"System.out.println(this.getBundle().getLocation());"


I observed different behaviours in different environments,


If the bundle is executed from Eclipse workspace from Eclipse 3.4, it is
"initial@reference:file:..\workspace\my.plugin".


If the bundle is executed from the exported RCP application from Eclipse
Eclipse 3.4, it is "plugins\my.plugin".


If the bundle is executed from Eclipse workspace from Eclipse 3.2, it is
"update@D:\workspace\my.plugin".


What could be the reason for this difference of behaviour in each case? In
one case its full absolute path, in another case it is relative path.


In one case 'update@' is prefixed in another case
'initial@reference:file:' is prefixed.


What could be reason to prefix the text like 'update@' and
'initial@reference:file:' in front of the location?


How can I get the absolute path of a plugin if its executed from the
workspace or from the exported rcp application.


Hope someone could help me out.


Regards,
Madhu
Re: Bundle Location in RCP [message #334229 is a reply to message #334226] Tue, 27 January 2009 09:43 Go to previous messageGo to next message
Eclipse UserFriend
Madhu Samuel wrote:
> Hello,
>
> I have a requirement to get the bundle location.

What are you actually trying to do? What behaviour do you need? Is it
that you are trying to access a file in your bundle? For that, use
Bundle#getEntry("/path/to/file") and then you can get the InputStream
from the URL

Can you use the URL and the InputStream in what you are doing?

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm
Re: Bundle Location in RCP [message #334234 is a reply to message #334229] Wed, 28 January 2009 07:28 Go to previous message
Eclipse UserFriend
Thanks Paul.

Yeah, I wanted to access a few files in the plugin. I will try it the way
you mentioned.

Regards,
Madhu
Previous Topic:Common Navigator - M5 - checking for objects that don't have content extensions
Next Topic:Passing parameters while executing command programmatically
Goto Forum:
  


Current Time: Sat Mar 22 12:08:54 EDT 2025

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

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

Back to the top