1、读取本工程下的文件
@Autowired private ResourceLoader resourceLoader; Resource resource = resourceLoader.getResource("classpath:\\file\\二标段.xlsx"); EasyExcelFactory.read(resource.getInputStream())
2、读取工程外的文件
boolean exists = Files.exists(Paths.get(opcProperties.getSectionOne())); if (exists) { log.info("从{}读取数据", opcProperties.getSectionOne()); EasyExcelFactory.read(Files.newInputStream(Paths.get(opcProperties.getSectionOne())))
标签:文件,springboot,opcProperties,Paths,exists,getSectionOne,读取 From: https://www.cnblogs.com/caesar-the-great/p/17072151.html