Package org.bndtools.utils.jar

Source Code of org.bndtools.utils.jar.JarUtils

package org.bndtools.utils.jar;

import java.io.IOException;
import java.io.InputStream;
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;

public class JarUtils {

    public static Manifest loadJarManifest(InputStream stream) throws IOException {
        JarInputStream jarInputStream = null;
        try {
            jarInputStream = new JarInputStream(stream);
            return jarInputStream.getManifest();
        } finally {
            if (jarInputStream != null) {
                try {
                    jarInputStream.close();
                } catch (IOException e) {
                    /* swallow */
                }
            }
        }
    }
}
TOP

Related Classes of org.bndtools.utils.jar.JarUtils

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.