String extensionDirs) {
if (mainClass == null) {
return null;
}
Manifest manifest = new Manifest();
Attributes mainAttributes = manifest.getMainAttributes();
mainAttributes.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
if (mainClass != null) {
mainAttributes.putValue(Attributes.Name.MAIN_CLASS.toString(), mainClass);
}
if (mainGBean != null) {
mainAttributes.putValue(CommandLineManifest.MAIN_GBEAN.toString(), mainGBean);
}
if (mainMethod != null) {
mainAttributes.putValue(CommandLineManifest.MAIN_METHOD.toString(), mainMethod);
}
if (manifestConfigurations != null) {
mainAttributes.putValue(CommandLineManifest.CONFIGURATIONS.toString(), manifestConfigurations);
}
if (classPath != null) {
mainAttributes.putValue(Attributes.Name.CLASS_PATH.toString(), classPath);
}
if (endorsedDirs != null) {
mainAttributes.putValue(CommandLineManifest.ENDORSED_DIRS.toString(), endorsedDirs);
}
if (extensionDirs != null) {
mainAttributes.putValue(CommandLineManifest.EXTENSION_DIRS.toString(), extensionDirs);
}
return manifest;
}