示例#1
0
 void expand(File jar, File dir) throws IOException {
   JarFile jarFile = new JarFile(jar);
   try {
     Enumeration<JarEntry> entries = jarFile.entries();
     while (entries.hasMoreElements()) {
       JarEntry je = entries.nextElement();
       if (!je.isDirectory()) {
         copy(jarFile.getInputStream(je), new File(dir, je.getName()));
       }
     }
   } finally {
     jarFile.close();
   }
 }
示例#2
0
文件: Installer.java 项目: suever/CTP
 private static Hashtable<String, String> getManifestAttributes(File jarFile) {
   Hashtable<String, String> h = new Hashtable<String, String>();
   JarFile jar = null;
   try {
     jar = new JarFile(jarFile);
     Manifest manifest = jar.getManifest();
     h = getManifestAttributes(manifest);
   } catch (Exception ex) {
   }
   if (jar != null) {
     try {
       jar.close();
     } catch (Exception ignore) {
     }
   }
   return h;
 }