Properties 读取配置文件

来源:互联网 发布:淘宝开店申请流程 编辑:程序博客网 时间:2024/06/05 10:26
    private static String context;    //文件路径    private static String fileBasePath;    static {        Properties pop = new Properties();        InputStream is = CreateHtmlUtil.class.getClassLoader().getResourceAsStream("App.properties");        try {            pop.load(is);            context = (String) pop.get("projectPath");            fileBasePath = (String)pop.get("fileBasePath");        } catch (IOException e) {            e.printStackTrace();        }    }
0 0
原创粉丝点击