读书人

storm topology all in one spring文件

发布时间: 2013-11-06 16:26:37 作者: rapoo

storm topology all in one spring文件合并
public class MergeMetaInf {public static void main(String[] args) throws IOException, URISyntaxException {File metaInfDir = new File("src/main/resources");ClassLoader classLoader = Thread.currentThread().getContextClassLoader();for (String name : new String[] {"META-INF/spring.factories", "META-INF/spring.handlers", "META-INF/spring.schemas", "META-INF/spring.tooling"}) {File file = new File(metaInfDir, name);if (!file.getParentFile().exists()) file.getParentFile().mkdirs();try (OutputStream out = new FileOutputStream(file)) {for (Enumeration<URL> iter = classLoader.getResources(name); iter.hasMoreElements();) {URL url = iter.nextElement();if (!url.getProtocol().equals("file")) {UtilIO.write(url.openStream(), out);out.write('\n');}}}}}}

?

读书人网 >行业软件

热点推荐