private Class<?> defineClassFromSelfContainedJarFiles(final String className) throws ClassNotFoundException {
        if (this.selfContainedJarCategory == null) {
            throw new ClassNotFoundException(className);
        }

        final String resourceName = className.replace('.', '/').concat(".class");

        // Class must be singular.
        final Resource resource;
        try {
            resource = SelfContainedJarFiles.getSingleResource(resourceName, this.selfContainedJarCategory);
        } catch (final IllegalArgumentException ex) {
            Holder.logger.info("Unexpected self-contained JAR category \"{}\" is requested for class \"{}\"",
                               this.selfContainedJarCategory, className);
            Holder.logger.debug("[NOT AN IMMEDIATE ERROR] Unexpected self-contained JAR category.", ex);
            throw new ClassNotFoundException(className, ex);
        }
        if (resource == null) {
            throw new ClassNotFoundException(className);
        }
        final URL codeSourceUrl = resource.getCodeSourceUrl();

        final int indexLastPeriod = className.lastIndexOf('.');
        if (indexLastPeriod != -1) {  // If |className| has a package part.
            final String packageName = className.substring(0, indexLastPeriod);
            final Manifest manifest = resource.getManifest();  // Class must be singular.

            if (!this.checkPackageSealing(packageName, manifest, codeSourceUrl)) {
                try {
                    if (manifest != null) {
                        this.definePackageFromManifest(packageName, manifest, codeSourceUrl);
                    } else {
                        this.definePackage(packageName, null, null, null, null, null, null, null);
                    }
                } catch (final IllegalArgumentException ex) {
                    if (!this.checkPackageSealing(packageName, manifest, codeSourceUrl)) {
                        throw new ClassNotFoundException(
                                "FATAL: Unexpected double failures to define package: " + packageName, ex);
                    }
                }
            }
        }

        final CodeSource codeSource = new CodeSource(codeSourceUrl, resource.getCodeSigners());
        return this.defineClass(className, resource.getAdjustedByteBuffer(), codeSource);
    }
Finds resources recognized as the given name.

<p>Note that {@link java.net.URLClassLoader#findResources} is public while {@link java.lang.ClassLoader#findResources}
is protected.
embulk-core/src/main/java/org/embulk/cli/SelfContainedJarAwareURLClassLoader.java