| 31 | static List<String> tlds = new ArrayList<>(List.of("com", "cn", "org", "io")); |
| 32 | |
| 33 | public static List<Path> getJarFiles(Path path) { |
| 34 | List<Path> jarFiles = new ArrayList<>(); |
| 35 | try { |
| 36 | Files.walk(path) |
| 37 | .filter(Files::isRegularFile) |
| 38 | .filter(p -> p.toString().endsWith(".jar")) |
| 39 | .forEach(jarFiles::add); |
| 40 | } catch (IOException e) { |
| 41 | e.printStackTrace(); |
| 42 | } |
| 43 | return jarFiles; |
| 44 | } |
| 45 | |
| 46 | public static void extractJar(Path jarFilePath, Path destDir) throws IOException { |
| 47 | File jarFile = jarFilePath.toFile(); |