In the eclipse API, how to get an IFile from a file that defines an external project or workspace

I want to create an IFile interface to open a file that defines an external project or workspace.

How to get IFile interface?

Regards, Simon

+3
source share
1 answer

http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_on_a_file_outside_the_workspace%3F

You can create a related resource:

IPath location = new Path(name);
IFile file = project.getFile(location.lastSegment());
file.createLink(location, IResource.NONE, null);

Or, if you can use the EFS interface (with Eclipse 3.3), you can use this instead of IFile.

+9
source

Source: https://habr.com/ru/post/1704421/


All Articles