springboot 读取resource下文件(IDE和jar内都能读到)

ClassPathResource resource = new ClassPathResource("static/office_template/word_replace_tpl.docx");
File sourceFile = resource.getFile();
InputStream fis = resource.getInputStream();

  参考:https://blog.csdn.net/zhuyu19911016520/article/details/98071242

posted @ 2021-12-21 18:54  半柠檬  阅读(69)  评论(0编辑  收藏  举报