private void scanJar()

in kernel/src/main/scala/org/apache/toree/utils/ClassPath.java [504:529]


        private void scanJar(
                File file, Set<File> scannedUris, ImmutableSet.Builder<ResourceInfo> builder)
                throws IOException {
            JarFile jarFile;
            try {
                jarFile = new JarFile(file);
            } catch (IOException e) {
                // Not a jar file
                return;
            }
            try {
                for (File path : getClassPathFromManifest(file, jarFile.getManifest())) {
                    // We only scan each file once independent of the classloader that file might be
                    // associated with.
                    if (scannedUris.add(path.getCanonicalFile())) {
                        scan(path, scannedUris, builder);
                    }
                }
                scanJarFile(jarFile, builder);
            } finally {
                try {
                    jarFile.close();
                } catch (IOException ignored) { // similar to try-with-resources, but don't fail scanning
                }
            }
        }