springboot读取resources文件夹下的文件
(2023-06-22 18:18:01)分类: springboot |
springboot读取resources文件夹下边的文件
//获取文件的相对路径 可在控制台打印查看输出结果
String filePath =
ResourceUtils.getFile("classpath:xml/custInfo.xml").getPath();
log.info("filePath: {}", filePath);
1
2
3
File file
=
ResourceUtils.getFile("classpath:template/科研项目模板.xlsx");
————————————————
版权声明:本文为CSDN博主「西京刀客」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/inthat/article/details/109071808
//获取文件的相对路径
————————————————
版权声明:本文为CSDN博主「西京刀客」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/inthat/article/details/109071808