问题
- SpringBoot 被打成 jar 包后,无法直接获取压缩包中的文件,只能通过流的方式获取文件内容
解决
- ClassPathResource
InputStream is = new ClassPathResource("/static/xxx.png").getInputStream();
InputStream is = new ClassPathResource("/static/xxx.png").getInputStream();
本文标题:【SpringBoot】Windows 和 Linux 环境下文
本文链接:https://www.haomeiwen.com/subject/mrwvwltx.html
网友评论