Reputation: 665
I'm working on a RCP project to build a modeller. Now I want to configure the workspace for my app, I found this article and just followed it. But when I call
ResourcesPlugin.getWorkspace().getRoot()
all it returned to me is a plash "/".
before made above call, I had configured my product running with argument like:
-os ${target.os} -arch ${target.arch} -nl ${target.nl} -consoleLog -data @noDefault
and set a workspace in start method of Application.java like:
Location instanceLoc = Platform.getInstanceLocation();
instanceLoc.set(new URL("file", null, "d:\\temp"), false);
I know I missed something but I can't figure it out. Please help me this.
Thank very much!
Upvotes: 1
Views: 1741
Reputation: 9535
Use ResourcesPlugin.getWorkspace().getRoot().getLocation()
instead.
In general: The Workspace API is an abstraction of your filesystem, so it does not know anything about the details of your underlying system to store files, the highest element is the workspace-root.
Upvotes: 1