标签:use 存在 resource extc read 路径问题 path 记录 property
使用了java这么久一直对java获取路径存在困惑,将一些常用的获取路径方式记录如下:
val property = System.getProperty("user.dir"))
以上是获取你的项目路径
Thread.currentThread().contextClassLoader.getResourceAsStream(fileName)
获取classpath下的文件
标签:use 存在 resource extc read 路径问题 path 记录 property
原文地址:http://www.cnblogs.com/zhangweilun/p/6258079.html