Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Bundle Location in RCP
Bundle Location in RCP [message #334226] Tue, 27 January 2009 13:20 Go to next message
Madhu Samuel is currently offline Madhu SamuelFriend
Messages: 199
Registered: July 2009
Senior Member
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 14:43 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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 12:28 Go to previous message
Madhu Samuel is currently offline Madhu SamuelFriend
Messages: 199
Registered: July 2009
Senior Member
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: Fri Apr 26 12:19:19 GMT 2024

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

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

Back to the top