How to get IWorkspace object from the path? [message #1001379] |
Wed, 16 January 2013 10:42  |
Eclipse User |
|
|
|
Hi,
I am new to plug-in development. I am developing a command line application, which takes workspace path as one of its arguments.
For further processing, I need to get IWorkspace object from the workspace path provided as an argument. How can I get the same?
ResourcesPlugin.getWorkspace() method gives the IWorkspace object of the Eclipse workspace I use. Aad also read that these methods cannot be used if the Eclipse workspace is closed as such.
Which other way can I get the IWorkspace object?
I apologise if my question seems stupid.
Thanks in advance,
Latha
|
|
|
Re: How to get IWorkspace object from the path? [message #1001413 is a reply to message #1001379] |
Wed, 16 January 2013 11:47  |
Eclipse User |
|
|
|
On 16/01/2013 15:42, Latha Shankara wrote:
> Hi,
>
> I am new to plug-in development. I am developing a command line application, which takes workspace path as one of its arguments.
>
> For further processing, I need to get IWorkspace object from the workspace path provided as an argument. How can I get the same?
>
> ResourcesPlugin.getWorkspace() method gives the IWorkspace object of the Eclipse workspace I use. Aad also read that these methods cannot be used if
> the Eclipse workspace is closed as such.
>
> Which other way can I get the IWorkspace object?
>
> I apologise if my question seems stupid.
>
> Thanks in advance,
> Latha
You can use ResourcesPlugin.getWorkspace() provided you launch the command line app using org.eclipse.equinox.launcher_xxx.jar with your application
defined using the org.eclipse.core.runtime.applications extension point. Your class needs to implement org.eclipse.equinox.app.IApplication.
The workspace is specified by the "-data path" command parameter which is handled by the launcher jar.
|
|
|
Powered by
FUDForum. Page generated in 0.10282 seconds