我想读取通常存储在以下位置的特定插件的首选项文件的绝对路径:
Platform.getLocation() + "\.metadata\.plugins\org.eclipse.core.runtime\.settings\myPlugin.prefs"
有什么办法可以使用eclipse提供的Apis直接获得它,而不是硬编码路径的第二部分吗?
这应该给出正确的位置:
Bundle rt = Platform.getBundle(IPreferencesConstants.RUNTIME_NAME);
IPath path = Platform.getStateLocation(rt).append(".settings").append("myPlugin").addFileExtension("prefs");
实际位置计算在 org.eclipse.core.internal.preferences.EclipsePreferences
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句