0

首先,大家好(/world)!

我正在制作一个 Eclipse RCP 应用程序,该应用程序需要检查位于我在运行时知道的一些插件中的一些.properties 。

我想知道是否有一种简单的方法来阅读它们,例如我知道在我的插件 *org.anyname.myplugins 中。mypluginthatrocks我有一个名为myawsomeproperties .properties* 的文件,我怎样才能打开它并使用类似的 getter/setter 系统轻松读取它

String getInProperties(String fileNameOrPath,String myPropertieId)
void setInProperties(String fileNameOrPath,String myPropertieId,String myPropertieValue)
或者
String getInProperties(File file,String myPropertieId)
void setInProperties(File file,String myPropertieId,String myPropertieValue)
或该类型中的任何其他意思,如果您明白我的意思...

提前谢谢^^

4

1 回答 1

1

好吧,如果这些只是普通的旧属性,那么有很好的旧ResourceBundle可以解决问题。

但是,如果您想这样做,恕我直言,更简洁一些,并且在更面向 Eclipse 的头脑中,我建议您创建一个使用 NLS 类的类,如此处所述

于 2009-07-23T09:28:47.427 回答