Java Jar Manifest getManifestHeaders(File aJarFile)

Here you can find the source of getManifestHeaders(File aJarFile)

Description

get Manifest Headers

License

Open Source License

Declaration

public static Properties getManifestHeaders(File aJarFile) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

import java.io.IOException;
import java.io.InputStream;

import java.util.Properties;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

public class Main {
    public static Properties getManifestHeaders(File aJarFile) throws IOException {
        ZipFile zipFile = new ZipFile(aJarFile);
        Properties properties = new Properties();
        try {/*  w ww  .  j  a  v  a 2  s .co m*/
            ZipEntry zipEntry = zipFile.getEntry("META-INF/MANIFEST.MF");
            InputStream is = zipFile.getInputStream(zipEntry);
            properties.load(is);
            is.close();
        } catch (Throwable t) {
        }
        zipFile.close();
        return properties;
    }
}

Related

  1. getManifestAttribute(Manifest m)
  2. getManifestAttribute(String jarUrl, String attribute)
  3. getManifestAttributes(File jarFile)
  4. getManifestEntryValue(IResource manifest, String entryKey)
  5. getManifestFileLocation(String moduleDir)
  6. getManifestHeaders(Manifest manifest)
  7. getManifestHeaderValues(final Manifest manifest, final String headerName)
  8. getManifestPath(String moduleDir)
  9. getManifestProperty(ClassLoader clContainingManifest, String manifestKey)