Java Properties 加载

static{
    Properties prop = new Properties();
    prop.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("configure.properties"));
    String path = properties.getProperty("reportOutPutPath");
}

获得一个线程读取configure.properties

从加载的Properties文件中读取属性

String path = properties.getProperty("reportOutPutPath");

posted @ 2017-10-09 18:31  翠微  阅读(129)  评论(0编辑  收藏  举报