@Override
    public URL findResource(final String resourceName) {
        // super.findResource(resourceName) finds both from the delegation parent ClassLoader and non-self-contained JARs.
        final URL resourceUrlFromSuper = super.findResource(resourceName);
        if (resourceUrlFromSuper != null) {
            return resourceUrlFromSuper;
        }

        if (this.selfContainedJarCategory != null) {
            // TODO: Consider duplicated resources.
            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 resource \"{}\".",
                                   this.selfContainedJarCategory, resourceName);
                Holder.logger.debug("[NOT AN IMMEDIATE ERROR] Unexpected self-contained JAR category.", ex);
                return null;
            }
            if (resource == null) {
                return null;
            }

            try {
                return AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() {
                        @Override
                        public URL run() throws MalformedURLException {
                            return resource.buildJarEmbeddedUrl();
                        }
                    }, this.accessControlContext);
            } catch (final PrivilegedActionException ignored) {
                // Pass through intentionally.
            }
        }

        return null;
    }
Finds a resource recognized as the given name.

<p>Resources found by the delegation parent {@link java.net.URLClassLoader} are always prioritized. Resources in
self-contained JAR file resources are looked into only when not found by the delegation parent {@code URLClassLoader}.

<p>Note that {@link java.net.URLClassLoader#findResource} is public while {@link java.lang.ClassLoader#findResource}
is protected.

@param resourceName  name of target resource
@return URL of the resource
embulk-core/src/main/java/org/embulk/cli/SelfContainedJarAwareURLClassLoader.java