SpringBoot读取templates文件夹文件
AI 摘要鱼粮不足,AI 今天先歇着 · 正文在下面
教程
文件路径

代码部分
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 条—
还没有评论,来说第一句