Reputation: 341
I am developing an eclipse plugin. But through plugin instead of getting current working workspace directory, its getting eclipse exe directory. How could i get the workspace directory through plugin ?
Upvotes: 0
Views: 250
Reputation: 111142
To get the root directory of the current workspace use:
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
IPath rootPath = root.getLocation();
IPath
has a toFile()
to get a File
or toOSString()
to convert to a String.
Upvotes: 2