ManifestProvider manifestProvider;
File selectedManifestFile;
if (manifestFile != null) {
if (manifestFile.isFile()) {
try {
manifestProvider = new FileManifestProvider(manifestFile);
selectedManifestFile = manifestFile;
} catch (IOException e) {
m_reporter.error("Cannot read Manifest from '" + manifestFile.getAbsolutePath() + "'");
return;
}
} else {
m_reporter.error("The manifest file " + manifestFile.getAbsolutePath() + " does not exist");
return;
}
} else {
// If the manifest is not specified, the m_dir/META-INF/MANIFEST.MF is used.
File metaInf = new File(directory, "META-INF");
File original = new File(metaInf, "MANIFEST.MF");
if (original.isFile()) {
try {
manifestProvider = new FileManifestProvider(original);
selectedManifestFile = original;
} catch (IOException e) {
m_reporter.error("Cannot read Manifest from '" + original.getAbsolutePath() + "'");
return;
}