Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to get IWorkspace object from the path?
https://www.eclipse.org/forums/index.php/mv/msg/449279/1001379/#msg_1001379
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]]>Latha Shankara2013-01-16T15:42:45-00:00Re: How to get IWorkspace object from the path?
https://www.eclipse.org/forums/index.php/mv/msg/449279/1001413/#msg_1001413
> 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.]]>Greg Pugh2013-01-16T16:47:31-00:00