IFile is part of the request to modify the workspace, not the actual file. IPath is also part of the request, which is valid in the workspace.
An IFile may not be physically contained in the workspace, for example. Git cloning project. Some IFile may be just a link, not an actual file. And some IFile may exist in a remote place.
Eclipse uses an independent file system called EFS. EFS manages files on the workspace and in its own file system. You can find the local file with EFS. (If it exists locally)
IFile file = ...; // gets URI for EFS. URI uri = file.getLocationURI(); // what if file is a link, resolve it. if(file.isLinked()){ uri = file.getRawLocationURI(); } // Gets native File using EFS File javaFile = EFS.getStore(uri).toLocalFile(0, new NullProgressMonitor());
source share