There are 2 code examples for java.util.jar.Manifest.

The API names are highlighted below. You can use suckoo button to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.

Project Name: jnode-core Package: org.jnode.boot

Source Code: InitJarProcessor.java (Click to view .java file)

Method Code:
vote
like

/** 
 * Gets the value of Main-Class-Arg1, Main-Class-Arg2 ...  from the initjar manifest.
 * @return the array of String arguments or an empty array if there are no arguments
 */
public String[] getMainClassArguments(){
  if (mf != null) {
    Attributes mainAttributes=mf.getMainAttributes();
    SortedMap<String,String> arg_map=new TreeMap<String,String>();
    for (    Object key : mainAttributes.keySet()) {
      String s=String.valueOf(key);
      if (s.startsWith("Main-Class-Arg")) {
        arg_map.put(s,String.valueOf(mainAttributes.get(key)));
      }
    }
    return arg_map.values().toArray(new String[arg_map.size()]);
  }
 else {
    return new String[0];
  }
}
 

Project Name: jnode-core Package: org.jnode.util

Source Code: JarBuffer.java (Click to view .java file)

Method Code:
vote
like

/** 
 * Returns the manifest for this JarFile or null when the JarFile does not
 * contain a manifest file.
 */
public Manifest getManifest() throws IOException {
  return manifest;
}