How can a obtain the workspace root?

In eclipse i can do it like this:

File getWorkspaceRoot() {
        return ResourcesPlugin.getWorkspace().getRoot().getRawLocation().makeAbsolute().toFile();
    }

1 comment
Comment actions Permalink

IntelliJ IDEA uses different terms than Eclipse, so there's no 'workspace' with the similar meaning. If you mean 'project' in terms of IntelliJ IDEA then you'll find the answer in the corresponding class: com.intellij.openapi.project.Project. though I'm not sure that's what you need as you didn't say what you are going to do with it.

0

Please sign in to leave a comment.