Source:
<code>public static Map<String, Object> getConfigFromClasspath(List<String> cp, Map<String, Object> conf) throws IOException { if (cp == null || cp.isEmpty()) { return conf; } Yaml yaml = new Yaml(new SafeConstructor()); Map<String, Object> defaultsConf = null; Map<String, Object> stormConf = null; for (String part: cp) { <START> String wildcardSuffix = File.separator + "*"; <END> if (part.endsWith(wildcardSuffix)) { File dir = new File(part.substring(0, part.length() - wildcardSuffix.length())); File[] jarFiles = dir.listFiles((dir1, name) -> name.endsWith(".jar")); if (jarFiles != null) { for (File jarFile : jarFiles) { JarConfigReader jarConfigReader = new JarConfigReader(yaml, defaultsConf, stormConf, jarFile).invoke(); defaultsConf = jarConfigReader.getDefaultsConf(); stormConf = jarConfigReader.getStormConf(); } } } else { File f = new File(part); if (f.isDirectory()) { if (defaultsConf == null) { defaultsConf = readConfIgnoreNotFound(yaml, new File(f, "defaults.yaml")); } if (stormConf == null) { stormConf = readConfIgnoreNotFound(yaml, new File(f, "storm.yaml")); } } else { JarConfigReader jarConfigReader = new JarConfigReader(yaml, defaultsConf, stormConf, f).invoke(); defaultsConf = jarConfigReader.getDefaultsConf(); stormConf = jarConfigReader.getStormConf(); } } } if (stormConf != null) { defaultsConf.putAll(stormConf); } return defaultsConf; }</code><technical_language>work check if part ends "*"</technical_language>

Target:
public static Map<String, Object> getConfigFromClasspath(List<String> cp, Map<String, Object> conf) throws IOException { if (cp == null || cp.isEmpty()) { return conf; } Yaml yaml = new Yaml(new SafeConstructor()); Map<String, Object> defaultsConf = null; Map<String, Object> stormConf = null; for (String part: cp) { File f = new File(part); if (f.getName().equals("*")) { File dir = f.getParentFile(); if (dir == null) { dir = new File("."); } File[] jarFiles = dir.listFiles((dir1, name) -> name.endsWith(".jar") || name.endsWith(".JAR")); if (jarFiles == null) { throw new IOException("Fail to list jar files in directory: " + dir); } for (File jarFile : jarFiles) { JarConfigReader jarConfigReader = new JarConfigReader(yaml, defaultsConf, stormConf, jarFile).readJar(); defaultsConf = jarConfigReader.getDefaultsConf(); stormConf = jarConfigReader.getStormConf(); } } else if (f.isDirectory()) { if (defaultsConf == null) { defaultsConf = readConfIgnoreNotFound(yaml, new File(f, "defaults.yaml")); } if (stormConf == null) { stormConf = readConfIgnoreNotFound(yaml, new File(f, "storm.yaml")); } } else if (f.isFile()) { String fileName = f.getName(); if (fileName.endsWith(".zip") || fileName.endsWith(".ZIP")) { JarConfigReader jarConfigReader = new JarConfigReader(yaml, defaultsConf, stormConf, f).readZip(); defaultsConf = jarConfigReader.getDefaultsConf(); stormConf = jarConfigReader.getStormConf(); } else if (fileName.endsWith(".jar") || fileName.endsWith(".JAR")) { JarConfigReader jarConfigReader = new JarConfigReader(yaml, defaultsConf, stormConf, f).readJar(); defaultsConf = jarConfigReader.getDefaultsConf(); stormConf = jarConfigReader.getStormConf(); } } } if (stormConf != null) { defaultsConf.putAll(stormConf); } return defaultsConf; }