eclipse中获得指定目录文件

eclipse中取得指定目录文件IWorkspace workspace ResourcesPlugin.getWorkspace() IPath location Path

eclipse中取得指定目录文件

IWorkspace workspace= ResourcesPlugin.getWorkspace();
IPath location= Path.fromOSString(file.getAbsolutePath());
IFile file= workspace.getRoot().getFilesForLocation(location);