首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

这个返回系统绝对根路径的方法哪位高手跟小弟我详细讲下

2013-09-07 
这个返回系统绝对根路径的方法谁跟我详细讲下public static final String getRootPath() {String path C

这个返回系统绝对根路径的方法谁跟我详细讲下
public static final String getRootPath() {
String path = Constants.class.getResource("/").toString();
return path.substring(6, path.length()).replace("%20", " ");
}

这里两句时什么意思啊,还有%20
[解决办法]
获取class所在文件路径,截取硬盘路径,%20是空格的显示,所以要还原。

热点排行