Here you can find the source of getManifest(ZipFile zip)
Use this utility to read Manifest from a JarFile or ZipFile due to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6735255
Parameter | Description |
---|---|
zip | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static Manifest getManifest(ZipFile zip) throws IOException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.io.InputStream; import java.util.jar.Manifest; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class Main { /**// ww w. j a v a 2 s . co m * Use this utility to read Manifest from a JarFile or ZipFile * due to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6735255 * * @param zip * @return * @throws IOException */ public static Manifest getManifest(ZipFile zip) throws IOException { ZipEntry entry = zip.getEntry("META-INF/MANIFEST.MF"); if (entry == null) return null; InputStream in = zip.getInputStream(entry); try { return new Manifest(in); } finally { // explicitly close due to // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6735255 in.close(); } } }