I have the following code snippet
URL url = new File("c:/work/projects/jars/").toURI().toURL();
URL[] urls = new URL[]{url};
URLClassLoader child = new URLClassLoader(urls, this.getClass().getClassLoader());
URL res = child.findResource("temp.txt");
cls = child.loadClass("com.foo.adapter.sample.PluginImpl");
The jars folder contains a text file "temp.txt" and a jar file which contiains the PluginImpl class. The resource is loaded but the class is not. When I extract the jar's contents to the folder the class is getting loaded. Where am I going wrong?