想读取resouce/temp下的test.txt文件。方式一:File sourceFile = ResourceUtils.getFile("classpath:temp/test.txt"); //这种方法在linux下无法工作
方式二:Resource resource = new ClassPathResource("temp/test.txt");File sourceFile = resource.getFile();