Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Plug-in's home directory (by code)?
Plug-in's home directory (by code)? [message #251725] Fri, 11 June 2004 06:52 Go to next message
Eclipse UserFriend
Originally posted by: ramim.kauhajoki.fi

Hi,

How do I find out the directory where my plug-in is installed by program?

I need to create several ASCII files and I thought I used the plug-in's
dir as the working directory !!

Thanks !!
Re: Plug-in's home directory (by code)? [message #251740 is a reply to message #251725] Fri, 11 June 2004 08:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pieter.west.NOSPAM.nl

noon wrote:
> Hi,
> How do I find out the directory where my plug-in is installed by program?
> I need to create several ASCII files and I thought I used the plug-in's
> dir as the working directory !!
> Thanks !!
>
The plugin installation directory should not be used to write files to
It's better to use YourPlugin.getDefault().getStateLocation()


If you have very good reasons, you can find the installation directory as
follows:
final URL url = Platform.find(Platform.getBundle(YourPlugin.PLUGIN_ID),new
Path("/"));
Re: Plug-in's home directory (by code)? [message #251756 is a reply to message #251740] Fri, 11 June 2004 08:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ramim.kauhajoki.fi

Hi,

Thanks for you quick answer :)

I think you're right. The location of the files should something else than
the plug-in's home directory ... e.g. incase of updates etc.

Where are these files located in the disc if I save them by the
"YourPlugin.getDefault().getStateLocation()" -method?

Pieter wrote:

> noon wrote:
> > Hi,
> > How do I find out the directory where my plug-in is installed by program?
> > I need to create several ASCII files and I thought I used the plug-in's
> > dir as the working directory !!
> > Thanks !!
> >
> The plugin installation directory should not be used to write files to
> It's better to use YourPlugin.getDefault().getStateLocation()


> If you have very good reasons, you can find the installation directory as
> follows:
> final URL url = Platform.find(Platform.getBundle(YourPlugin.PLUGIN_ID),new
> Path("/"));
Re: Plug-in's home directory (by code)? [message #251778 is a reply to message #251756] Fri, 11 June 2004 09:23 Go to previous message
Eclipse UserFriend
Originally posted by: pieter.west.NOSPAM.nl

noon wrote:

> Hi,

> Thanks for you quick answer :)

> I think you're right. The location of the files should something else than
> the plug-in's home directory ... e.g. incase of updates etc.

> Where are these files located in the disc if I save them by the
> "YourPlugin.getDefault().getStateLocation()" -method?

Just read the API
Previous Topic:How to move text editor cursor on right click?
Next Topic:Template
Goto Forum:
  


Current Time: Sun Jun 08 09:21:46 EDT 2025

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

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

Back to the top