Exemplo n.º 1
0
 public void show(InputStream is) throws IOException {
   JarArchiveInputStream jais = new JarArchiveInputStream(is);
   JarArchiveEntry e = jais.getNextJarEntry();
   while (e != null) {
     if ((!e.isDirectory()) && e.getName().endsWith(".jar")) {
       cache(e.getName(), jais);
     }
     e = jais.getNextJarEntry();
   }
 }
Exemplo n.º 2
0
 private InputStream getResourceAsStream(String name, InputStream is) throws IOException {
   JarArchiveInputStream jais = new JarArchiveInputStream(is);
   JarArchiveEntry e = jais.getNextJarEntry();
   while (e != null) {
     if ((!e.isDirectory()) && e.getName().equals(name)) {
       return jais;
     }
     e = jais.getNextJarEntry();
   }
   return null;
 }
Exemplo n.º 3
0
 private void cache(String name, InputStream is) throws IOException {
   JarArchiveInputStream jais = null;
   try {
     jais = new JarArchiveInputStream(is);
     JarArchiveEntry e = jais.getNextJarEntry();
     while (e != null) {
       if (!e.isDirectory()) {
         classCache.put(e.getName(), name);
       }
       e = jais.getNextJarEntry();
     }
   } finally {
     // IOUtils.closeQuietly(jais);
   }
 }