Eclipse 获取当前工程下某文件

来源:互联网 发布:mac coat风衣 编辑:程序博客网 时间:2024/06/04 14:42

<code>

Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);URL pluginUrl = Platform.find(bundle, new org.eclipse.core.runtime.Path("plugin.xml"));URL pluginFileUrl = null;try {pluginFileUrl = Platform.asLocalURL(pluginUrl);} catch (IOException e) {e.printStackTrace();}Path x = new Path(pluginFileUrl.getPath());Path y = new Path(x.removeLastSegments(1).toString());File file = new File(y + "//component.xml");

</code>

原创粉丝点击