精选圈子榜单优站
Nemo
Nemo
管理员
路漫漫其修远兮,吾将上下而求索。

java中获取当前项目类路径下的配置文件


GlobalUtils.log.info("\n###开始读取配置文件...");
Map<String,String> map = new HashMap<String, String>();
Properties pps = new Properties();
String path = ConfigUtils.class.getResource("/").toString().replaceAll("file:/", "");  
File file = new File(path+"/com/nemo/config/config.properties");
pps.load(new FileInputStream(file));

  • 若文章侵犯了您的权益,请联系我们进行处理。

  • 2016-07-24
  • 2974阅读
评论