Would like to get plugin installed location [message #195237] |
Tue, 20 February 2007 22:20 |
Eclipse User |
|
|
|
Originally posted by: subramanianj.schneider.com
I have installed Eclipse in directory(C:\Eclipse\eclipse\plugins) and
would like to get this path from my plugin code. I have tried
String location = DebugPlugin.getDefault().getStateLocation();
would return plugin location of workspace and not the installed location.
Could someone please help me getting installed location.
thanks
JP
|
|
|
|
Re: Would like to get plugin installed location [message #195363 is a reply to message #195303] |
Wed, 21 February 2007 15:40 |
Eclipse User |
|
|
|
Originally posted by: subramanianj.schneider.com
Thanks Sophie. I have put my question wrong. Sorry that was my bad.
I have a my plugin called xxxPlugin and have file(xxx.properties) inside
that plugin and would like to read file(xxx.properties) in the
code(org.sni.eclipse.xxxAction) that exists in xxxPlugin.
xxxPlugin
|
|
--org.sni.eclipse
| |
| - xxxAction
|
--xxx.properties
Could you please let me know, how to read that file.
|
|
|
Re: Would like to get plugin installed location [message #195370 is a reply to message #195363] |
Wed, 21 February 2007 15:51 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
JP,
Try MyPlugin.getDefault().getBundle().getEntry("xxx.properties").
JP Subramanian wrote:
> Thanks Sophie. I have put my question wrong. Sorry that was my bad.
>
> I have a my plugin called xxxPlugin and have file(xxx.properties)
> inside that plugin and would like to read file(xxx.properties) in the
> code(org.sni.eclipse.xxxAction) that exists in xxxPlugin.
>
>
> xxxPlugin
> |
> |
> --org.sni.eclipse
> | |
> | - xxxAction
> |
> --xxx.properties
> Could you please let me know, how to read that file.
>
>
>
|
|
|
Re: Would like to get plugin installed location [message #195423 is a reply to message #195370] |
Wed, 21 February 2007 19:24 |
Eclipse User |
|
|
|
Originally posted by: subramanianj.schneider.com
Thanks Ed.
Here is the code used to read resource file in plugin.
InputStream ios = myActivator.getDefault().getBundle().getResource(
"jp.properties").openStream();
BufferedReader in = new BufferedReader(new InputStreamReader(ios));
String inputLine;
while ((inputLine = in.readLine()) != null)
{
System.out.println(inputLine);
}
in.close();
|
|
|
|
Powered by
FUDForum. Page generated in 0.29753 seconds