public static List<Class<?>> processJarfile(URL resource, String pkgname) {
		List<Class<?>> classes = new ArrayList<Class<?>>();
		
		//Turn package name to relative path to jar file
		String relPath = pkgname.replace('.', '/');
		log("relative path: "+relPath);
		String resPath = resource.getPath();
		log("resource path: "+resPath);
		String jarPath = resPath.replaceFirst("[.]jar[!].*", ".jar").replaceFirst("file:", "");
		// jarPath = jarPath.replace(" ", "\\ ");
		log("Reading JAR file: '" + jarPath + "'");
		JarFile jarFile;
		
		try {
			jarFile = new JarFile(jarPath);         
		} 
		catch (IOException e) {
			throw new RuntimeException("Unexpected IOException reading JAR File '" + jarPath + "'", e);
		}
		
		//get contents of jar file and iterate through them
		Enumeration<JarEntry> entries = jarFile.entries();
		while(entries.hasMoreElements()) {
			JarEntry entry = entries.nextElement();
			
			//Get content name from jar file
			String entryName = entry.getName();
			String className = null;
			
			//If content is a class save class name.
			if(entryName.endsWith(".class") && entryName.startsWith(relPath) 
					&& entryName.length() > (relPath.length() + "/".length())) {
				className = entryName.replace('/', '.').replace('\\', '.').replace(".class", "");
			}
			
			log("JarEntry '" + entryName + "'  =>  class '" + className + "'");
			
			//If content is a class add class to List
			if (className != null) {
				classes.add(loadClass(className));
			}
		}
		return classes;
	}