获取指定文件的绝对路径

String path = this.getClass().getClassLoader().getResource("").getPath() + "conf/test.xml";
path = URLDecoder.decode(path, "utf-8");

猜你喜欢

转载自blog.csdn.net/baidu_20608025/article/details/85326054