标签:
public static Map<String, String> readProperties(String path) { Map<String, String> map = new HashMap<String, String>(); try { Properties props = new Properties(); path=URLDecoder.decode(path,"utf-8"); // System.out.println(path); props.load(new FileInputStream(path)); Enumeration<?> enum1 = props.propertyNames(); while(enum1.hasMoreElements()) { String strKey = (String) enum1.nextElement(); String strValue = props.getProperty(strKey); map.put(strKey, strValue); } } catch (IOException e) { e.printStackTrace(); } return map; }
PropertiesUtil 工具类 properties文件的读取
标签:
原文地址:http://www.cnblogs.com/ButterFuture/p/4721871.html