ClassUtil { public static Set<String> getResources(String pResource) throws IOException { List<ClassLoader> clls = findClassLoaders(); if (clls.size() != 0) { Set<String> ret = new HashSet<String>(); for (ClassLoader cll : clls) { Enumeration<URL> urlEnum = cll.getResources(pResource); ret.addAll(extractUrlAsStringsFromEnumeration(urlEnum)); } return ret; } else { return extractUrlAsStringsFromEnumeration(ClassLoader.getSystemResources(pResource)); } } private  ClassUtil(); static Class<T> classForName(String pClassName, ClassLoader ... pClassLoaders); static Class<T> classForName(String pClassName,boolean pInitialize,ClassLoader ... pClassLoaders); static InputStream getResourceAsStream(String pPath); static boolean checkForClass(String pClassName); static T newInstance(String pClassName, Object ... pArguments); static T newInstance(Class<T> pClass, Object ... pArguments); static Object applyMethod(Object pObject, String pMethod, Object ... pArgs); static Set<String> getResources(String pResource);  }
@Test public void testGetResources() throws IOException { Set<String> urls = ClassUtil.getResources("META-INF/detectors"); assertNotNull(urls); assertEquals(urls.size(),1); }