Code example for JarFile

Methods: close, getManifest

0
    if (me == null) {
      return ""; 
    } 
 
    try { 
      final JarFile jar = new JarFile(me);
      try { 
        Manifest mf = jar.getManifest();
        Attributes att = mf.getMainAttributes();
        String val = att.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
        return val != null ? val : "";
      } finally { 
        jar.close();
      } 
    } catch (IOException e) {
      return ""; 
    } 
  } 
 
  private static int invokeProgram(final ClassLoader loader,
      final String[] origArgv) throws Exception {