Code example for URLClassLoader

Methods: loadClass

0
	} 
 
	private Class<?> loadClass(String className) throws ClassNotFoundException {
		URL url = getClass().getResource("/");
		ClassLoader parent = ClassLoader.getSystemClassLoader().getParent();
		ClassLoader loader = new URLClassLoader(new URL[] { url }, parent);
		return loader.loadClass(className);
	} 
 
	private void staticAccess(Class<?> classVersion, String methodName) throws IllegalAccessException, SecurityException, NoSuchMethodException, IllegalArgumentException,
			InvocationTargetException { 
		Method method = classVersion.getMethod(methodName, (Class[]) null);
		method.invoke(classVersion, (Object[]) null);
	} 
 
}