public static Set<Path> pluginLocations(String pluginPath, boolean failFast) {
        if (pluginPath == null) {
            return Collections.emptySet();
        }
        String[] pluginPathElements = COMMA_WITH_WHITESPACE.split(pluginPath.trim(), -1);
        Set<Path> pluginLocations = new LinkedHashSet<>();
        for (String path : pluginPathElements) {
            try {
                Path pluginPathElement = Paths.get(path).toAbsolutePath();
                if (pluginPath.isEmpty()) {
                    log.warn("Plugin path element is empty, evaluating to {}.", pluginPathElement);
                }
                if (!Files.exists(pluginPathElement)) {
                    throw new FileNotFoundException(pluginPathElement.toString());
                }
                // Currently 'plugin.paths' property is a list of top-level directories
                // containing plugins
                if (Files.isDirectory(pluginPathElement)) {
                    pluginLocations.addAll(pluginLocations(pluginPathElement));
                } else if (isArchive(pluginPathElement)) {
                    pluginLocations.add(pluginPathElement);
                }
            } catch (InvalidPathException | IOException e) {
                if (failFast) {
                    throw new RuntimeException(e);
                }
                log.error("Could not get listing for plugin path: {}. Ignoring.", path, e);
            }
        }
        return pluginLocations;
    }
Return whether a path corresponds java class file.

@param path the path to validate.
@return true if the path is a java class file, otherwise false.
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java