Nemo

Nemo 关注TA

路漫漫其修远兮,吾将上下而求索。

Nemo

Nemo

关注TA

路漫漫其修远兮,吾将上下而求索。

  •  普罗旺斯
  • 负责帅就完事了
  • 写了1,495,102字

该文章投稿至Nemo社区   Java  板块 复制链接


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

发布于 2016/07/24 01:13 2,658浏览 0回复 344

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));
点赞(0)
本文标签
 java

上一个文章:SQL SERVER资源死锁

下一个文章:1W个设备同时在线的TCP SERVER

点了个评