首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

storm topology all in one spring文件归拢

2013-11-06 
storm topology all in one spring文件合并public class MergeMetaInf {public static void main(String[]

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');}}}}}}

?

热点排行