| 11 | import java.util.stream.Stream; |
| 12 | |
| 13 | public class ClearScan implements IScan { |
| 14 | @Override |
| 15 | public void scan(String dir, String fileName) throws Exception { |
| 16 | try (Stream<Path> paths = Files.walk(Paths.get(dir))) { |
| 17 | paths.map(Path::toString).filter(f -> f.endsWith(".class")) |
| 18 | .collect(Collectors.toList()) |
| 19 | .forEach(c-> (new File(c)).delete()); |
| 20 | } catch (IOException e) { |
| 21 | e.printStackTrace(); |
| 22 | } |
| 23 | System.out.println("Clear模式结束"); |
| 24 | } |
| 25 | } |
nothing calls this directly
no outgoing calls
no test coverage detected