InputStream is = OneJarTask.class.getResourceAsStream(ONE_JAR_BOOT);
if (is == null)
throw new IOException("Unable to load default " + ONE_JAR_BOOT + ": consider using the <one-jar onejarboot=\"...\"> option.");
// Pull the manifest out and use it.
JarInputStream jis = new JarInputStream(is);
Manifest manifest = new Manifest();
java.util.jar.Manifest jmanifest = jis.getManifest();
java.util.jar.Attributes jattributes = jmanifest.getMainAttributes();
try {
// Specify our Created-By and Main-Class attributes as overrides.
manifest.addConfiguredAttribute(new Attribute("Created-By", "One-Jar 0.98 Ant taskdef"));
manifest.addConfiguredAttribute(new Attribute(MAIN_CLASS, jattributes.getValue(MAIN_CLASS)));
if (oneJarMainClass != null) {
manifest.addConfiguredAttribute(new Attribute(Boot.ONE_JAR_MAIN_CLASS, oneJarMainClass));
}
super.addConfiguredManifest(manifest);
} catch (ManifestException mx) {
throw new BuildException(mx);
}