public void process(File jarFile, Object bundleDesc, ClassLoader loader) throws java.io.IOException { this.jarFile = jarFile; JarFile jf = new JarFile(jarFile); try { Enumeration<JarEntry> entriesEnum = jf.entries(); while(entriesEnum.hasMoreElements()) { JarEntry je = entriesEnum.nextElement(); if (je.getName().endsWith(".class")) { entries.add(je); } } } finally { jf.close(); } initTypes(jarFile); }
public Set<Class> getElements() { Set<Class> elements = new HashSet<Class>(); if (getClassLoader()==null) { AnnotationUtils.getLogger().severe("Class loader null"); return elements; } for (JarEntry je : entries) { String fileName = je.getName(); // convert to a class name... String className = fileName.replace(File.separatorChar, '.'); className = className.substring(0, className.length()-6); try { elements.add(classLoader.loadClass(className)); } catch(ClassNotFoundException cnfe) { cnfe.printStackTrace(); } } return elements; }
public Set<Class> getElements() { Set<Class> elements = new HashSet<Class>(); if (getClassLoader()==null) { AnnotationUtils.getLogger().severe("Class loader null"); return elements; } for (JarEntry je : entries) { String fileName = je.getName(); // convert to a class name... String className = fileName.replace(File.separatorChar, '.'); className = className.substring(0, className.length()-6); try { elements.add(classLoader.loadClass(className)); } catch(ClassNotFoundException cnfe) { cnfe.printStackTrace(); } } return elements; }
public void process(File jarFile, Object bundleDesc, ClassLoader loader) throws java.io.IOException { this.jarFile = jarFile; JarFile jf = new JarFile(jarFile); try { Enumeration<JarEntry> entriesEnum = jf.entries(); while(entriesEnum.hasMoreElements()) { JarEntry je = entriesEnum.nextElement(); if (je.getName().endsWith(".class")) { entries.add(je); } } } finally { jf.close(); } initTypes(jarFile); }