读取property文件内容

来源:互联网 发布:剑网三dbm数据库 编辑:程序博客网 时间:2024/06/05 05:34
package com.lm.listener;import java.io.IOException;import java.io.InputStream;import java.util.LinkedHashMap;import java.util.Map;import java.util.Properties;/** *  * @author kris * */public class DataConstants {public static String file_path = null;public static String dowmdoc=null;public static String downFile=null;static {InputStream inputStream = Constants.class.getResourceAsStream("path.properties");      Properties p = new Properties();          try {p.load(inputStream);dowmdoc=p.getProperty("doc_path");file_path = p.getProperty("file_path");img_path = p.getProperty("img_path");downFile=p.getProperty("downFile");} catch (IOException e) {e.printStackTrace();}    }public static Map<String, Map<Integer,String>> dataMap = null;   //事例    public static Map<Integer, String> sexs = new LinkedHashMap<Integer, String>();public static String img_path;           static {    sexs.put(0, "--");    sexs.put(1, "否");    sexs.put(2, "是");       }    }

0 0
原创粉丝点击