MCPcopy Create free account
hub / github.com/LFYSec/MScan / getJarFiles

Method getJarFiles

src/main/java/fdu/secsys/microservice/util/JarUtil.java:33–44  ·  view source on GitHub ↗
(Path path)

Source from the content-addressed store, hash-verified

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();

Callers 1

parseJarMethod · 0.95

Calls 3

filterMethod · 0.80
forEachMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected