目开发过程中,使用properties文件作为配置基本上是必不可少的,很多如系统配置信息,文件上传配置信息等等都是以这种方式进行保存。
同时学会操作properties文件也是java基础。
/**
* @Copyright @ 2012
* All right reserved
* @version 创建时间:Created on Oct 31, 2012
* @author 作者:Create by www.360buyli.com
* @Email : 360buyli@gmail.com
* @description java如何读取和遍历properties文件
*/
public class PropertiesUtil {
public static Map
Properties prop = new Properties();
Map
InputStream in = PropertiesUtil.class.getResourceAsStream(fileName);
try {
prop.load(in);
Set