Skip to content

Instantly share code, notes, and snippets.

@jashkenas
Created April 11, 2009 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jashkenas/93695 to your computer and use it in GitHub Desktop.
Save jashkenas/93695 to your computer and use it in GitHub Desktop.
URL[] urlList = new URL[archives.length];
for (int j = 0; j < urlList.length; j++) {
urlList[j] = archives[j].toURL();
}
URLClassLoader loader = new URLClassLoader(urlList);
String className = null;
for (int j = 0; j < archives.length; j++) {
className = findClassInZipFile(folders[i].getName(), archives[j]);
if (className != null) break;
}
// If no class name found, just move on.
if (className == null) continue;
Class toolClass = Class.forName(className, true, loader);
final Tool tool = (Tool) toolClass.newInstance();
tool.init(Editor.this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment