//图片路径
String img = this.getClass().getClassLoader().getResource("static/ygd.png").getPath();
//获取resource下路径
String notificationDocxPath = ResourceUtils.getFile("/static/xxx.docx").getPath();
//获取resource下stream文件
InputStream input = ClassUtils
.getDefaultClassLoader()
.getResourceAsStream("template/xxx.docx");
//获取文件路径
String img = this.getClass().getResource("/static/ygd.png").getPath();
获取resource文件下的文件路径或者stream流文件
最新推荐文章于 2024-06-05 14:36:41 发布