/** * Scans the jars of the JarScanner finding all items matching the path filter * @param pathFilter * the filter to find items in the jars * @return * Collections of items of the jars matching the filter */ private Collection<String> scanJar(Predicate<Path> pathFilter) { return jars.parallelStream() .map(JarScanner::createJarUri) .flatMap(u -> scanJar(u, pathFilter).stream()) .distinct() .collect(Collectors.toList()); }
/** * Scans the specified jars for packages and returns a list of all packages found in that jar. The scanner only * collects packages that contain class files. * * @return a collection of all package names found in the jar */ public Collection<String> scanPackages() { return scanJar(p -> Files.isDirectory(p) && containsClassFiles(p) && !isIgnored(p.toAbsolutePath())); }
/** * Scans the specified jars for packages and returns a list of all packages found in that jar. The scanner makes no * distinction between packages and folders. * * @return a collection of all classes names found in the jar */ public Collection<String> scanClasses() { return scanJar(p -> isClassFile(p) && !isIgnored(p.toAbsolutePath())); }