springboot读取resources文件夹下边的文件 //获取文件的相对路径 可在控制台打印查看输出结果 String filePath = ResourceUtils.getFile("classpath:xml/custInfo.xml").getPath(); log.info("filePath: {}", filePath); File file = ResourceUtils.getFile("classpath:template/科研项目模板.xlsx");