How to get working plugin path [message #274741] |
Thu, 28 October 2004 05:10 |
Eclipse User |
|
|
|
Originally posted by: tanut.sanuk.biz
My plugin must have ability to access Components folder which contain
addition .class.
I would like to locate my Components folder as
[Eclipse path]\plugins\myPlugin1.0.0\Components\......
And now for in-development, I have locate Component folder as
[Eclipse path]\workspace\myPlugin1.0.0\bin\Components\....
now I get working path by
workingPath =
[pluginClass].getClass().getProtectionDomain().getCodeSource ().getLocation()
..getPath();
But I guess it isn't the best way to do. since I must export plugin as JAR
file when my plugin finish.
So are there other way to get it?
Thank you very much.
Tanut Apiwong
|
|
|
Re: How to get working plugin path [message #274790 is a reply to message #274741] |
Thu, 28 October 2004 14:21 |
Eclipse User |
|
|
|
Originally posted by: chaves.nospam.inf.ufsc.br.please
You can get your plug-in's install location by using the following API:
* org.eclipse.core.runtime.IPluginDescriptor.getInstallURL() for pre-3.0
plug-ins
* org.osgi.framework.Bundle.getEntry(String) for 3.x plug-ins
Rafael
Tanut Apiwong wrote:
> My plugin must have ability to access Components folder which contain
> addition .class.
> I would like to locate my Components folder as
> [Eclipse path]pluginsmyPlugin1.0.0Components......
> And now for in-development, I have locate Component folder as
> [Eclipse path]workspacemyPlugin1.0.0binComponents....
> now I get working path by
> workingPath =
> [pluginClass].getClass().getProtectionDomain().getCodeSource ().getLocation()
> ..getPath();
> But I guess it isn't the best way to do. since I must export plugin as JAR
> file when my plugin finish.
> So are there other way to get it?
> Thank you very much.
> Tanut Apiwong
|
|
|
|
Re: How to get working plugin path [message #274843 is a reply to message #274822] |
Fri, 29 October 2004 14:53 |
Eclipse User |
|
|
|
Originally posted by: chaves.nospam.inf.ufsc.br.please
Yes, it is supposed to work. But it is not recommended for new plug-ins
that don't need to run on Eclipse 2.*.
Rafael
Tanut Apiwong wrote:
> Thanks :)
> but Will org.eclipse.core.runtime.IPluginDescriptor.getInstallURL() work
> with 3.x system?
> Tanut Apiwong ^_^
|
|
|
Powered by
FUDForum. Page generated in 0.03602 seconds