springboot 打包jar 运行找资源文件

使用如下方式读取文件:
ClassPathResource cpr = new ClassPathResource("static/ok.png");
byte[] bdata = FileCopyUtils.copyToByteArray(cpr.getInputStream());
posted @ 2019-12-18 09:40  Fernando_Y  阅读(307)  评论(0编辑  收藏  举报