public ClassFinder(ClassLoader classLoader, Collection<URL> urls) { this.classLoader = classLoader; List<String> classNames = new ArrayList<String>(); for (URL location : urls) { try { if (location.getProtocol().equals("jar")) { classNames.addAll(jar(location)); } else if (location.getProtocol().equals("file")) { try { // See if it's actually a jar URL jarUrl = new URL("jar", "", location.toExternalForm() + "!/"); JarURLConnection juc = (JarURLConnection) jarUrl.openConnection(); juc.getJarFile(); classNames.addAll(jar(jarUrl)); } catch (IOException e) { classNames.addAll(file(location)); } } } catch (Exception e) { e.printStackTrace(); } } for (String className : classNames) { readClassDef(className); } }
public ClassFinder(ClassLoader classLoader, Collection<URL> urls) { this.classLoader = classLoader; List<String> classNames = new ArrayList<String>(); for (URL location : urls) { try { if (location.getProtocol().equals("jar")) { classNames.addAll(jar(location)); } else if (location.getProtocol().equals("file")) { try { // See if it's actually a jar URL jarUrl = new URL("jar", "", location.toExternalForm() + "!/"); JarURLConnection juc = (JarURLConnection) jarUrl.openConnection(); juc.getJarFile(); classNames.addAll(jar(jarUrl)); } catch (IOException e) { classNames.addAll(file(location)); } } } catch (Exception e) { e.printStackTrace(); } } for (String className : classNames) { readClassDef(className); } }
public ClassFinder(ClassLoader classLoader, Collection<URL> urls) { this.classLoader = classLoader; List<String> classNames = new ArrayList<String>(); for (URL location : urls) { try { if (location.getProtocol().equals("jar")) { classNames.addAll(jar(location)); } else if (location.getProtocol().equals("file")) { try { // See if it's actually a jar URL jarUrl = new URL("jar", "", location.toExternalForm() + "!/"); JarURLConnection juc = (JarURLConnection) jarUrl.openConnection(); juc.getJarFile(); classNames.addAll(jar(jarUrl)); } catch (IOException e) { classNames.addAll(file(location)); } } } catch (Exception e) { e.printStackTrace(); } } for (String className : classNames) { readClassDef(className); } }