Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Access to a folder in my plugin
Access to a folder in my plugin [message #296357] Wed, 21 December 2005 02:51 Go to next message
Eclipse UserFriend
Originally posted by: prooteus_NOSPAM.gmx.net

Hi,

in my Eclipse plugin, I have a folger images where I would like to
store images that I generate programmatically.

I thought using

String fileName = "images\\1.png";
URL url = ComparisonPlugin.getDefault().find(new Path(fileName));
String path = url.getFile();

would work, but url is always null.

How do I get the path to this folder?

Thanks,
Stefan
Re: Access to a folder in my plugin [message #296458 is a reply to message #296357] Thu, 22 December 2005 09:59 Go to previous messageGo to next message
Eclipse UserFriend
The following should work for you, just include your bundle name.

URL url = Platform.find(Platform.getBundle("com.blah.blah"), path);

"Stefan Knieling" <prooteus_NOSPAM@gmx.net> wrote in message
news:dob1hv$1ku$1@utils.eclipse.org...
> Hi,
>
> in my Eclipse plugin, I have a folger images where I would like to store
> images that I generate programmatically.
>
> I thought using
>
> String fileName = "images\\1.png";
> URL url = ComparisonPlugin.getDefault().find(new Path(fileName));
> String path = url.getFile();
>
> would work, but url is always null.
>
> How do I get the path to this folder?
>
> Thanks,
> Stefan
>
>
Re: Access to a folder in my plugin [message #296785 is a reply to message #296357] Tue, 03 January 2006 09:01 Go to previous messageGo to next message
Eclipse UserFriend
Don't forget that your plugin folder is potentially read-only when it is
deployed ... either because it's a single jar file, or depending on the
setup it might have been installed read-only by the administrator.

There are other levels of configuration areas (user, workspace, etc)
that you can store generated images in.

Later,
PW
Re: Access to a folder in my plugin [message #296846 is a reply to message #296785] Tue, 03 January 2006 12:19 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

In fact, there is an area specifically reserved to create plugin
specific files.

It is Platform.getStateLocation(bundle)

This returns an IPath to a local directory in your workspace where your
plugin can store plugin wide files. (I.e. any files that are for the
plugin, not ones for specific projects).

Paul Webster wrote:
> Don't forget that your plugin folder is potentially read-only when it is
> deployed ... either because it's a single jar file, or depending on the
> setup it might have been installed read-only by the administrator.
>
> There are other levels of configuration areas (user, workspace, etc)
> that you can store generated images in.
>
> Later,
> PW
>

--
Thanks,
Rich Kulp
Previous Topic:Showing Editor in a View
Next Topic:Eclipse-LazyStart
Goto Forum:
  


Current Time: Sun Nov 09 04:20:52 EST 2025

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

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

Back to the top