maven中获取resources目录路径

时间:2020-05-10 13:58:40   收藏:0   阅读:321

在maven中文件位置

获取resources目录路径:
String path = Demo.class.getClassLoader().getResource("").getPath();
获取Demo.class文件所在的目录路径
String path = Demo.class.getResource("").getPath();

原文:https://www.cnblogs.com/sheldonxiun/p/12862961.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!