If you have the absolute path to the file the following is likely what you want:
Path path = new Path("D:\\test\\testfile.txt"))
IFile ifile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
... where Path is org.eclipse.core.runtime.Path. Bit easier that iterating, even though in @greg-449 's answer you should only have one entry in the array ;-)