public static PluginSource isolatedPluginSource(Path pluginLocation, ClassLoader parent, PluginClassLoaderFactory factory) throws IOException {
        List<URL> pluginUrls = new ArrayList<>();
        List<Path> paths = pluginUrls(pluginLocation);
        // Infer the type of the source
        PluginSource.Type type;
        if (paths.size() == 1 && paths.get(0) == pluginLocation) {
            if (PluginUtils.isArchive(pluginLocation)) {
                type = PluginSource.Type.SINGLE_JAR;
            } else {
                type = PluginSource.Type.CLASS_HIERARCHY;
            }
        } else {
            type = PluginSource.Type.MULTI_JAR;
        }
        for (Path path : paths) {
            pluginUrls.add(path.toUri().toURL());
        }
        URL[] urls = pluginUrls.toArray(new URL[0]);
        PluginClassLoader loader = factory.newPluginClassLoader(
                pluginLocation.toUri().toURL(),
                urls,
                parent
        );
        return new PluginSource(pluginLocation, type, loader, urls);
    }
Given a top path in the filesystem, return a list of paths to archives (JAR or ZIP
files) contained under this top path. If the top path contains only java class files,
return the top path itself. This method follows symbolic links to discover archives and
returns the such archives as absolute paths.

@param topPath the path to use as root of plugin search.
@return a list of potential plugin paths, or empty list if no such paths exist.
@throws IOException
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java