SpringBoot读取templates文件夹文件

2023-08-27后端1 分钟110 次阅读
AI 摘要鱼粮不足,AI 今天先歇着 · 正文在下面

教程

文件路径
image.png
代码部分

java 复制代码
  void test() throws IOException {
	String path = "dict/china_star.bdict";
        ResourceLoader resourceLoader = new DefaultResourceLoader();
        Resource resource = resourceLoader.getResource("classpath:/templates/" + path);
        InputStream inputStream =resource.getInputStream() ;
  }
觉得有用就点个赞,不用登录也能读

评论

0 条
登录 之后才能评论
—
还没有评论,来说第一句