您的位置:首页 > 编程语言 > Java开发

Eclipse插件开发中File和IFile的转换

2018-03-25 16:50 260 查看
(1) File转IFile第一种方法:IFile[] ifile = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(file.toURI());第二种方法:String filepath =file.getPath();IProject proj =ResourcesPlugin.getWorkspace().getRoot().getProject(projName);String path =filepath.substring(proj.getLocation().toString().length() + 1);IFile file =proj.getFile(path);   (2) IFile转FileFile file = ifile.getLocation().toFile;或者File = newFile(ifile.getLocation().toOSString);   
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: