Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » How to get file location from a BundleDescription
How to get file location from a BundleDescription [message #85769] Sun, 01 April 2007 22:34 Go to next message
Aaron Cohen is currently offline Aaron CohenFriend
Messages: 21
Registered: July 2009
Junior Member
I am able to retrieve the location via getLocation() but I need
something that can be used to create a File object and not "update@../".

Thanks!
Re: How to get file location from a BundleDescription [message #85784 is a reply to message #85769] Mon, 02 April 2007 05:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

You shouldn't assume that there's a File location available. You can use 'getClass().getResourceAsStream()' to load the contents. If you need a File for legacy API usage, then extract a copy to the PluginStateLocation first.

Alex
Re: How to get file location from a BundleDescription [message #85799 is a reply to message #85784] Mon, 02 April 2007 11:53 Go to previous messageGo to next message
Aaron Cohen is currently offline Aaron CohenFriend
Messages: 21
Registered: July 2009
Junior Member
Thank you for the fast response. I am trying to find away to locate the
plug-ins mentioned in the .state files in configuration directory. I am
reading in the State and looking at the bundle Descriptions using
StateObjectFactory. Unfortunately there doesn't seem to be a pointer
from the configuration directory back to the Eclipse Directory. Do you
know of any?

Alex Blewitt wrote:
> You shouldn't assume that there's a File location available. You can use 'getClass().getResourceAsStream()' to load the contents. If you need a File for legacy API usage, then extract a copy to the PluginStateLocation first.
>
> Alex
Re: How to get file location from a BundleDescription [message #85829 is a reply to message #85799] Mon, 02 April 2007 20:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

The configuration directory isn't really used for configuration. It's more like the equinox work area.

Plugins access state using the Plugin.getStateLocation() directory.

http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/api/org/eclipse/core/runtime/Plat form.html

http://help.eclipse.org/help32/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/core/runtime/Plugin.html#get StateLocation()

That will create you an IPath, and then you can put whatever files in there that you want.

Alex.
Re: How to get file location from a BundleDescription [message #85990 is a reply to message #85829] Tue, 03 April 2007 20:20 Go to previous messageGo to next message
Aaron Cohen is currently offline Aaron CohenFriend
Messages: 21
Registered: July 2009
Junior Member
Let me take a step back. I am writing an application to diagnose Eclipse
Instances on the User's computer. I have been using the configuration
directory since I can gather Bundle Information and find missing
dependencies without starting the Eclipse Instance.

Thanks.


Alex Blewitt wrote:
> The configuration directory isn't really used for configuration. It's more like the equinox work area.
>
> Plugins access state using the Plugin.getStateLocation() directory.
>
> http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/api/org/eclipse/core/runtime/Plat form.html
>
> http://help.eclipse.org/help32/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/core/runtime/Plugin.html#get StateLocation()
>
> That will create you an IPath, and then you can put whatever files in there that you want.
>
> Alex.
Re: How to get file location from a BundleDescription [message #86035 is a reply to message #85990] Wed, 04 April 2007 05:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

Ah, so you're probing internal state of the configuration directory to do some specific Equinox-probing; right. I don't think there's any exposed API to deal with that, but I could be wrong; you might get better results (if no-one else replies here) by posting a message to the equinox-dev mailing list.

Alex.
Re: How to get file location from a BundleDescription [message #86098 is a reply to message #86035] Wed, 04 April 2007 12:20 Go to previous messageGo to next message
Aaron Cohen is currently offline Aaron CohenFriend
Messages: 21
Registered: July 2009
Junior Member
Alex Blewitt wrote:
> Ah, so you're probing internal state of the configuration directory to do some specific Equinox-probing; right. I don't think there's any exposed API to deal with that, but I could be wrong; you might get better results (if no-one else replies here) by posting a message to the equinox-dev mailing list.
>
> Alex.
It looks like the getLocation() method of the BundleDescriptor returns a
relative path. So if I can figure out whhich eclipse instance used a
configuration directory, I may be able to put the 2 together. However I
cannot find any pointer in the configuration directory back to the
Eclipse executable. Do you know of any?
Re: How to get file location from a BundleDescription [message #87398 is a reply to message #86098] Wed, 02 May 2007 19:37 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
Aaron Cohen wrote:
> It looks like the getLocation() method of the BundleDescriptor returns a
> relative path. So if I can figure out whhich eclipse instance used a
> configuration directory, I may be able to put the 2 together. However I
> cannot find any pointer in the configuration directory back to the
> Eclipse executable. Do you know of any?

The getLocation method of BundleDescription returns the location string
used to install the bundle. This string can be anything, there is no
requirement for it to be a real path. That being said the paths in the
location are by convention relative to the eclipse installation. The
real path information for the bundles is stored in the .bundledata file
in the org.eclipse.osgi configuration cache. There is currently no api
for reading this internal data structure.

Tom.
Previous Topic:org.eclipse.ui.workbench.texteditor.rulerColumns Extension Point
Next Topic:How to determine which configuration directory is used by an Eclipse Instance
Goto Forum:
  


Current Time: Fri Apr 19 23:49:11 GMT 2024

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

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

Back to the top