Java Jar Manifest getManifest(ZipFile zipFile)

Here you can find the source of getManifest(ZipFile zipFile)

Description

get Manifest

License

Open Source License

Declaration

public static Manifest getManifest(ZipFile zipFile) throws IOException 

Method Source Code

//package com.java2s;
/*//from   w  w w .ja  v a 2 s.  c  om
 * ZAL - The abstraction layer for Zimbra.
 * Copyright (C) 2014 ZeXtras S.r.l.
 *
 * This file is part of ZAL.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation, version 2 of
 * the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with ZAL. If not, see <http://www.gnu.org/licenses/>.
 */

import java.io.IOException;

import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

public class Main {
    private static final String MANIFEST = "META-INF/MANIFEST.MF";

    public static Manifest getManifest(ZipFile zipFile) throws IOException {
        ZipEntry manifestEntry = zipFile.getEntry(MANIFEST);
        return new Manifest(zipFile.getInputStream(manifestEntry));
    }
}

Related

  1. getManifest(final String jarFileName)
  2. getManifest(JarFile pluginJarFile)
  3. getManifest(String className)
  4. getManifest(String path)
  5. getManifest(ZipFile zip)
  6. getManifestAttribute(InputStream in, String attr)
  7. getManifestAttribute(Manifest m)
  8. getManifestAttribute(String jarUrl, String attribute)
  9. getManifestAttributes(File jarFile)