如何获取resources文件夹中文件的完整路径?
- 内容介绍
- 文章标签
- 相关推荐
本文共计44个文字,预计阅读时间需要1分钟。
javaString path=ClassLoader.getSystemResource(system_name.json).getPath();String path2=Thread.currentThread().getContextClassLoader().getResource(system_name.json).getPath();
String path = Object.class.getClassLoader().getResource("system_name.json").getPath(); gistfile2.txt
String path = Thread.currentThread().getContextClassLoader().getResource("system_name.json").getPath();
本文共计44个文字,预计阅读时间需要1分钟。
javaString path=ClassLoader.getSystemResource(system_name.json).getPath();String path2=Thread.currentThread().getContextClassLoader().getResource(system_name.json).getPath();
String path = Object.class.getClassLoader().getResource("system_name.json").getPath(); gistfile2.txt
String path = Thread.currentThread().getContextClassLoader().getResource("system_name.json").getPath();

