public static Map < String , String > processArchiveManifest ( final JarFile jarFile ) throws Throwable { Map < String , String > manifestAttrs = null ; if ( jarFile != null ) { try { manifestAttrs = AccessController . doPrivileged ( new PrivilegedExceptionAction < Map < String , String > > ( ) { @ Override public Map < String , String > run ( ) throws ZipException , IOException { InputStream is = null ; Map < String , String > attrs = null ; try { // Read the manifest and access the manifest headers. is = jarFile . getInputStream ( jarFile . getEntry ( JarFile . MANIFEST_NAME ) ) ; attrs = ManifestProcessor . readManifestIntoMap ( ManifestProcessor . parseManifest ( is ) ) ; } finally { if ( is != null ) { InstallUtils . close ( is ) ; } } return attrs ; } } ) ; } catch ( PrivilegedActionException e ) { throw e . getCause ( ) ; } } return manifestAttrs ; }
Gets the archive file Manifest attributes as a String Map from a jar file .