Java Jar Manifest getManifest(File in)

Here you can find the source of getManifest(File in)

Description

Assumes the given file is a jar and retrieves the manifest.

License

Open Source License

Parameter

Parameter Description
in a parameter

Exception

Parameter Description
IOException an exception

Declaration

private static Manifest getManifest(File in) throws IOException 

Method Source Code


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

import java.io.File;

import java.io.IOException;

import java.util.jar.JarFile;

import java.util.jar.Manifest;

public class Main {
    /**//from w w  w . j a v a  2  s .  c o  m
     * Assumes the given file is a jar and retrieves the manifest.
     * 
     * @param in
     * @return
     * @throws IOException
     */
    private static Manifest getManifest(File in) throws IOException {
        JarFile jar = new JarFile(in);
        Manifest manifest = jar.getManifest();
        jar.close();
        return manifest;
    }
}

Related

  1. getHeader(String name, Manifest manifest)
  2. getMainAttributeValue(Manifest manifest, String attribute)
  3. getManifest()
  4. getManifest()
  5. getManifest(File file)
  6. getManifest(File jarFile)
  7. getManifest(File pluginFile)
  8. getManifest(final String jarFileName)
  9. getManifest(JarFile pluginJarFile)