歡迎您光臨本站 註冊首頁

Commons Configuration 2.0-beta1 發布

←手機掃碼閱讀     admin @ 2015-06-22 , reply:0

Commons Configuration 2.0-beta1 發布,此版本相比 Alpha 版本並沒有太大修改,移除了一個過時的介面。雖然非常接近穩定版本,但是還是有不兼容的改進。

Commons Configuration 2.0 版本最主要的是重新設計 Configuration API。

完整改進請看:http://www.apache.org/dist/commons/configuration/RELEASE-NOTES.txt 

1.x 用戶升級說明:http://commons.apache.org/configuration/userguide/upgradeto2_0.html 

源代碼和二進位包下載:

http://commons.apache.org/proper/commons-configuration/download_configuration.cgi 

Commons Configuration 是一個java應用程序的配置管理類庫。可以從properties或者xml文件中載入軟體的配置信息,用來構建支撐軟體運 行的基礎環境。在一些配置文件較多較的複雜的情況下,使用該配置工具比較可以簡化配置文件的解析和管理。也提高了開發效率和軟體的可維護性。

下面是一個載入 properties 配置文件的代碼:

CompositeConfiguration config = new CompositeConfiguration();
config.addConfiguration(
new PropertiesConfiguration("oschina.properties"));

String usernaem = config.getString(
"username");
String password = config.getString(
"password");


[admin ] Commons Configuration 2.0-beta1 發布已經有494次圍觀

http://coctec.com/news/all/show-post-204777.html