}
/* the first header in the file should be the global one.
* It should say "Manifest-Version: x.x"; if not add it
*/
MessageHeader globals = (MessageHeader) entries.elementAt(0);
if (globals.findValue("Manifest-Version") == null) {
/* Assume this is a user-defined manifest. If it has a Name: <..>
* field, then it is not global, in which case we just add our own
* global Manifest-version: <version>
* If the first MessageHeader has no Name: <..>, we assume it
* is a global header and so prepend Manifest to it.
*/
String jdkVersion = System.getProperty("java.version");
if (globals.findValue("Name") == null) {
globals.prepend("Manifest-Version", VERSION);
globals.add("Created-By", "Manifest JDK "+jdkVersion);
} else {
ps.print("Manifest-Version: "+VERSION+"\r\n"+
"Created-By: "+jdkVersion+"\r\n\r\n");
}
ps.flush();
}
globals.print(ps);
for (int i = 1; i < entries.size(); ++i) {
MessageHeader mh = (MessageHeader) entries.elementAt(i);
mh.print(ps);
}
}