public static Set<PluginSource> pluginSources(Set<Path> pluginLocations, ClassLoader classLoader, PluginClassLoaderFactory factory) {
        Set<PluginSource> pluginSources = new LinkedHashSet<>();
        for (Path pluginLocation : pluginLocations) {
            try {
                pluginSources.add(isolatedPluginSource(pluginLocation, classLoader, factory));
            } catch (InvalidPathException | MalformedURLException e) {
                log.error("Invalid path in plugin path: {}. Ignoring.", pluginLocation, e);
            } catch (IOException e) {
                log.error("Could not get listing for plugin path: {}. Ignoring.", pluginLocation, e);
            }
        }
        pluginSources.add(classpathPluginSource(classLoader.getParent()));
        return pluginSources;
    }
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