精选圈子榜单优站
编程综合
编程综合
技术
20关注
编程技术记录、分享 ,记录你的编程生活点点滴滴!

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
  • 2971阅读
评论