springboot文件读取
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())))