Here you can find the source of loadAllAutoConfigFiles(ClassLoader classloader)
public static List<URL> loadAllAutoConfigFiles(ClassLoader classloader)
//package com.java2s; /*/* w w w. j av a 2 s .c o m*/ * Copyright 2011-2016 ZXC.com All right reserved. This software is the confidential and proprietary information of * ZXC.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into with ZXC.com. */ import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; public class Main { public static List<URL> loadAllAutoConfigFiles(ClassLoader classloader) { List<URL> urlList = new ArrayList<URL>(); urlList.addAll(loadAutoConfigFiles(classloader, "META-INF/autoconf/auto-config.xml")); urlList.addAll(loadAutoConfigFiles(classloader, "META-INF/auto-config.xml")); return urlList; } protected static List<URL> loadAutoConfigFiles(ClassLoader classLoader, String resourceName) { try { List<URL> urlList = new ArrayList<URL>(); Enumeration<URL> urls = classLoader.getResources(resourceName); for (; urls.hasMoreElements();) { URL url = urls.nextElement(); urlList.add(url); } return urlList; } catch (IOException e) { return new ArrayList<URL>(); } } }