首页 > 编程语言 > 详细

springboot项目获取resource下的文件

时间:2019-08-06 11:31:34      阅读:561      评论:0      收藏:0      [点我收藏+]
package com.expr.exceldemo;

import org.springframework.core.io.ClassPathResource;

public class Test {
    public static void main(String[] args) {
        ClassPathResource classPathResource = new ClassPathResource("2019年4月园企业经营情况表(当月值).xlsx");
        boolean exists = classPathResource.exists();
        System.out.println(exists);
    }
}

代码中的那个excel就在项目的resource(资源文件夹下放着)。

springboot项目获取resource下的文件

原文:https://www.cnblogs.com/prader6/p/11307845.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!