因为jar运行部署后无法获取内部文件路径,所以不能使用path
InputStream resourceAsStream =
new ClassPathResource("files/official_doc_model.docx").getInputStream();
springboot 打成jar包 docker部署服务器后 获取jar包中资源文件
最新推荐文章于 2024-07-26 12:14:03 发布
因为jar运行部署后无法获取内部文件路径,所以不能使用path
InputStream resourceAsStream =
new ClassPathResource("files/official_doc_model.docx").getInputStream();