private static URL[] classpathToURLs(String classPath) {
        ArrayList<URL> urls = new ArrayList<>();
        for (String path : classPath.split(File.pathSeparator)) {
            if (path == null || path.trim().isEmpty())
                continue;
            File file = new File(path);

            try {
                if (path.endsWith("/*")) {
                    File parent = new File(new File(file.getCanonicalPath()).getParent());
                    if (parent.isDirectory()) {
                        File[] files = parent.listFiles((dir, name) -> {
                            String lower = name.toLowerCase(Locale.ROOT);
                            return lower.endsWith(".jar") || lower.endsWith(".zip");
                        });
                        if (files != null) {
                            for (File jarFile : files) {
                                urls.add(jarFile.getCanonicalFile().toURI().toURL());
                            }
                        }
                    }
                } else if (file.exists()) {
                    urls.add(file.getCanonicalFile().toURI().toURL());
                }
            } catch (IOException e) {
                throw new KafkaException(e);
            }
        }
        return urls.toArray(new URL[0]);
    }
@param classPath Class path string
@param parent    The parent classloader. If the required class / resource cannot be found in the given classPath,
                 this classloader will be used to find the class / resource.
clients/src/main/java/org/apache/kafka/common/utils/ChildFirstClassLoader.java