public static List<String> getResourceListing(ClassLoader cl) throws URISyntaxException, IOException {
	URL dirURL = cl.getResource("");
	if (dirURL != null && dirURL.getProtocol().equals("file")) {
	    File f = new File(dirURL.toURI());
	    return recurse(f, f.getAbsolutePath().replace('\\', '/'));
	}

	if (dirURL.getProtocol().equals("jar")) {
	    String jarPath = dirURL.getPath().substring(5, dirURL.getPath().indexOf("!"));
	    JarFile jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"));
	    Enumeration<JarEntry> entries = jar.entries();
	    Set<String> result = new HashSet<String>();
	    while (entries.hasMoreElements())
		result.add("/" + entries.nextElement().getName().replace('\\', '/'));
	    jar.close();
	    return new ArrayList<String>(result);
	}

	throw new UnsupportedOperationException("Cannot list files for URL " + dirURL);
    }