@Override public Void apply(JarFile jarFile, JarEntry jarEntry) throws NotAppliedException, $.Break { try { String fileName = jarEntry.getName(); if (fileName.startsWith("conf/")) { FastStr fs = FastStr.of(fileName).afterFirst('/'); String env = ConfLoader.common(); if (fs.contains('/')) { env = fs.beforeFirst('/').intern(); } Properties p = map.get(env); if (null == p) { p = new Properties(); map.put(env, p); } InputStream is = jarFile.getInputStream(jarEntry); Properties p2 = new Properties(); p2.load(is); p.putAll(p2); } } catch (IOException e) { logger.warn(e, "Unable to load properties file from jar entry %s", jarEntry.getName()); } return null; } };
@Override public Void apply(JarFile jarFile, JarEntry jarEntry) throws NotAppliedException, $.Break { try { String fileName = jarEntry.getName(); if (fileName.startsWith("conf/")) { FastStr fs = FastStr.of(fileName).afterFirst('/'); String env = ConfLoader.common(); if (fs.contains('/')) { env = fs.beforeFirst('/').intern(); } Properties p = map.get(env); if (null == p) { p = new Properties(); map.put(env, p); } InputStream is = jarFile.getInputStream(jarEntry); Properties p2 = new Properties(); p2.load(is); p.putAll(p2); } } catch (IOException e) { logger.warn(e, "Unable to load properties file from jar entry %s", jarEntry.getName()); } return null; } };