title: How to convert from File to IFile in java, for files outside the project?
body: <p>Normally, this code is used for converting from <code>File</code> to <code>IFile</code>:</p>
  
  <pre><code>IWorkspace workspace= ResourcesPlugin.getWorkspace();    
  IPath location= Path.fromOSString(file.getAbsolutePath()); 
  IFile ifile= workspace.getRoot().getFileForLocation(location);
  </code></pre>
  
  <p>But this only works for java files within the project. How can I get the <code>IFile</code> when <code>File</code> file is not in the workspace (not in the project)?</p>