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; }
时间: 2024-10-29 00:46:52