* working copy.
* @throws CoreException if error occurred while loading an existing
* manifest file.
*/
public DeploymentInfoWorkingCopy load(IProgressMonitor monitor) throws CoreException {
SubMonitor subMonitor = SubMonitor.convert(monitor);
subMonitor.beginTask("Parsing and loading application manifest file", 6); //$NON-NLS-1$
DeploymentInfoWorkingCopy workingCopy;
try {
workingCopy = appModule.resolveDeploymentInfoWorkingCopy(subMonitor);
Map<?, ?> application = getApplication(null);
subMonitor.worked(1);
if (application == null) {
return null;
}
// NOTE: When reading from manifest, the manifest may be INCOMPLETE,
// therefore do not automatically
// set all properties in the deployment info. Check if the value of
// the
// property is actually set before set value
// in the info
String appName = getStringValue(application, NAME_PROP);
subMonitor.worked(1);
if (appName != null) {
workingCopy.setDeploymentName(appName);
}
readMemory(application, workingCopy);
subMonitor.worked(1);
readApplicationURL(application, workingCopy, appName, monitor);
subMonitor.worked(1);
String buildpackurl = getStringValue(application, BUILDPACK_PROP);
if (buildpackurl != null) {
Staging staging = new Staging(null, buildpackurl);
workingCopy.setStaging(staging);
}
readEnvars(workingCopy, application);
subMonitor.worked(1);
readServices(workingCopy, application);
subMonitor.worked(1);
String archiveURL = getStringValue(application, PATH_PROP);
if (archiveURL != null) {
workingCopy.setArchive(archiveURL);
}
}
finally {
subMonitor.done();
}
return workingCopy;
}