Java Jar Manifest getManifestAttribute(InputStream in, String attr)

Here you can find the source of getManifestAttribute(InputStream in, String attr)

Description

get Manifest Attribute

License

LGPL

Declaration

public static String getManifestAttribute(InputStream in, String attr) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.util.jar.Attributes;
import java.util.jar.Manifest;

public class Main {
    public static String getManifestAttribute(InputStream in, String attr) {
        try {//from  ww  w.  jav  a  2s. co  m
            Manifest manifest = new Manifest(in);
            Attributes attributes = manifest.getMainAttributes();
            return attributes.getValue(attr);
        } catch (IOException ex) {
            throw new UncheckedIOException(ex);
        }
    }
}

Related

  1. getManifest(JarFile pluginJarFile)
  2. getManifest(String className)
  3. getManifest(String path)
  4. getManifest(ZipFile zip)
  5. getManifest(ZipFile zipFile)
  6. getManifestAttribute(Manifest m)
  7. getManifestAttribute(String jarUrl, String attribute)
  8. getManifestAttributes(File jarFile)
  9. getManifestEntryValue(IResource manifest, String entryKey)