引入依赖
<dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.11.0</version> </dependency>
code 拷贝文件夹
@PostMapping("/findB00List") @CrossOrigin public Result findB00List(String b00) throws SQLException, IOException { // 拷贝文件夹 File file1 = new File("E:\\test01"); File file2 = new File("E:\\test02"); FileUtils.copyDirectoryToDirectory(file1,file2); // 拷贝文件 /*File file3 = new File("day13\\aaa\\hbCopy1.jpg"); File file4 = new File("day13\\fff"); FileUtils.copyFileToDirectory(file3,file4);*/ List<String> B00List= dictService.findB00List(b00); return Result.ok(B00List); }
code 拷贝文件