Here you can find the source of getManifestAttributes(File jarFile)
public static Hashtable<String, String> getManifestAttributes(File jarFile)
//package com.java2s; /*--------------------------------------------------------------- * Copyright 2011 by the Radiological Society of North America * * This source software is released under the terms of the * RSNA Public License (http://mirc.rsna.org/rsnapubliclicense) *----------------------------------------------------------------*/ import java.io.*; import java.util.*; import java.util.jar.*; public class Main { public static Hashtable<String, String> getManifestAttributes(String path) { return getManifestAttributes(new File(path)); }/*from w w w .jav a2s. c om*/ public 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) { h = null; } if (jar != null) { try { jar.close(); } catch (Exception ignore) { } } return h; } public static Hashtable<String, String> getManifestAttributes(Manifest manifest) { Hashtable<String, String> h = new Hashtable<String, String>(); try { Attributes attrs = manifest.getMainAttributes(); Iterator it = attrs.keySet().iterator(); while (it.hasNext()) { String key = it.next().toString(); h.put(key, attrs.getValue(key)); } } catch (Exception ignore) { } return h; } }