获取指定文件的绝对路径

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

你可能感兴趣的:(java)