If you File refers to a file in your workspace, then yes you can convert it
to an IFile.
Use:
java.io.File file = ...;
Path path = new Path(file.getAbsolutePath());
IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
If it's not in the workspace, there is no corresponding IFile so you cannot
convert.
Subscribe to:
Post Comments (Atom)
1 comment:
Forgot to mention, took this part of code from http://dev.eclipse.org/newslists/news.eclipse.tools/msg16521.html
Post a Comment