Commons Configuration 1.8發(fā)布 配置管理Java類庫
Commons Configuration是一個java應用程序的配置管理類庫。可以從properties或者xml文件中加載軟件的配置信息,用來構(gòu)建支撐軟件運 行的基礎環(huán)境。在一些配置文件較多較的復雜的情況下,使用該配置工具比較可以簡化配置文件的解析和管理。也提高了開發(fā)效率和軟件的可維護性。
下面是一個加載 properties 配置文件的代碼:
CompositeConfiguration config = new CompositeConfiguration();
config.addConfiguration(new PropertiesConfiguration("oschina.properties"));
String usernaem = config.getString("username");
String password = config.getString("password");
1.8 版本要求*** Java 1.5 的支持,API 為 Java 5 做了一些微調(diào),在二進制上是兼容 1.7 版本的,因此可直接升級。
完整改進記錄:
http://commons.apache.org/configuration/changes-report.html
下載地址:
http://commons.apache.org/configuration/download_configuration.cgi
原文鏈接:http://www.oschina.net/news/25357/commons-configuration-1-8-released
【編輯推薦】