Reputation: 514
I can check if a project exists on the Eclipse workspace with:
ResourcesPlugin.getWorkspace().getRoot().exists(IPath path)
However this does not check if the project was "soft" deleted before and already exists on disk.
How do I check if the project already exists on disk?
Upvotes: 2
Views: 782
Reputation: 111142
You can use the the workspace location to get a normal Java File
object:
IPath workspacePath = ResourcesPlugin.getWorkspace().getRoot().getLocation();
IPath fullPath = workspacePath.append(relative path);
File file = fullPath.toFile();
Upvotes: 2