ITeye博客

读起配置文件

fudehai001 · 2008-12-08 22:34 · java · Markdown

public static HashMap readPropertyFile(String file) throws IOException{ HashMap map = new HashMap(); InputStream is = FileUtil.class.getResourceAsStream(file); Properties properties = new Properties(); properties.load(is); Enumeration en = properties.propertyNames(); while( en.hasMoreElements()){ String key=(String)en.nextElement(); String code = new String(properties.getProperty(key).getBytes("ISO-8859-1"),"gbk"); map.put(key,code); if (GlobalNames.DEBUG_PERFERMANCE_FLAG) { System.out.println(file+":"+code); } } return map; }

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。