private static List<Path> pluginLocations(Path pluginPathElement) throws IOException {
        List<Path> locations = new ArrayList<>();
        try (
                DirectoryStream<Path> listing = Files.newDirectoryStream(
                        pluginPathElement,
                        PLUGIN_PATH_FILTER
                )
        ) {
            for (Path dir : listing) {
                locations.add(dir);
            }
        }
        return locations;
    }
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