Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Getting plugin location using bundle.getEntry("/")
Getting plugin location using bundle.getEntry("/") [message #267440] Tue, 17 August 2004 20:34 Go to next message
Eclipse UserFriend
In eclipse 2.1.3 version we were able to get the location (eg. C:\Program
Files\..\eclipse\plugins\com.ibm.xyz) of a plugin with the aid of pluginId
in the following way.
URL installURL =

Platform.getPluginRegistry().getPluginDescriptor(pluginId).g etInstallURL();
String location = Platform.resolve(installURL).getFile();

In eclipse 3.0, getPluginRegistry() and getInstallURL() are deprecated.

Looking at the Eclipse API docs, the solution is to use the following code
something like this...

URL installURL = Platform.getBundle(pluginId).getEntry("/");
String location = Platform.resolve(installURL).getFile();

But I observe that the Platform.resolve(installURL).getFile(), actually
resolves the plugin URL location to something like (eg. \C:\Program
Files\..\eclipse\plugins\com.ibm.xyz)

Notice the extra slash at the starting of the path, before the driver
letter.
Which causes me problems finding the dll's at the plugin location.

I am pretty sure, people might have seen this.

One solution that I can think of is using....

URL installURL = Platform.getBundle(pluginId).getEntry("/");
String location = Platform.resolve(installURL).getFile().substring(1);

To elliminate the starting slash, Is that reasonable? Any ideas in this
regard would be really appreciated. I really want to do the right thing.

Thanks for your time.

Cheers,
Pavan.
Re: Getting plugin location using bundle.getEntry("/") [message #267572 is a reply to message #267440] Wed, 18 August 2004 11:25 Go to previous messageGo to next message
Eclipse UserFriend
Hello Evryone,

I have looked at the posting and responses to "Programmatically
getting plugin install location", but I still would appreciate if someone
could comment on my solution. Since I do not really want to find the file
but want to get the plugin install location and use it in bunch of
different places.

I am curious about the comments from Eclipse team regarding this topic.
Please respond. Thanks.

Note: I have gone through the Eclipse documentation on recommended changes
for Eclipse 3.0 and Eclipse API Java doc regarding this matter.

Cheers,
Pavan.

Pavan Kumar Immaneni wrote:

> In eclipse 2.1.3 version we were able to get the location (eg. C:Program
> Files..eclipsepluginscom.ibm.xyz) of a plugin with the aid of pluginId
> in the following way.
> URL installURL =

> Platform.getPluginRegistry().getPluginDescriptor(pluginId).g etInstallURL();
> String location = Platform.resolve(installURL).getFile();

> In eclipse 3.0, getPluginRegistry() and getInstallURL() are deprecated.

> Looking at the Eclipse API docs, the solution is to use the following code
> something like this...

> URL installURL = Platform.getBundle(pluginId).getEntry("/");
> String location = Platform.resolve(installURL).getFile();

> But I observe that the Platform.resolve(installURL).getFile(), actually
> resolves the plugin URL location to something like (eg. C:Program
> Files..eclipsepluginscom.ibm.xyz)

> Notice the extra slash at the starting of the path, before the driver
> letter.
> Which causes me problems finding the dll's at the plugin location.

> I am pretty sure, people might have seen this.

> One solution that I can think of is using....

> URL installURL = Platform.getBundle(pluginId).getEntry("/");
> String location = Platform.resolve(installURL).getFile().substring(1);

> To elliminate the starting slash, Is that reasonable? Any ideas in this
> regard would be really appreciated. I really want to do the right thing.

> Thanks for your time.

> Cheers,
> Pavan.
Re: Getting plugin location using bundle.getEntry("/") [message #267595 is a reply to message #267572] Wed, 18 August 2004 11:59 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

It depends on what you want it for. Because it may not even be a
directory on your local system. It may be a directory within a jar file,
it may be a directory accessed thru http. You don't know. A url to a
directory should only be used as a parent url to another url.



--
Thanks, Rich Kulp

Previous Topic:how to path to get Eclipse install directory programmatically?
Next Topic:IStatus.matches(IStatus.OK) always return false intended?
Goto Forum:
  


Current Time: Fri May 16 06:34:47 EDT 2025

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

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

Back to the top