There are 1 code examples for java.util.jar.Attributes.

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];
  }
}