workspaceConfig = SoapuiWorkspaceDocumentConfig.Factory.parse(file);
if (workspaceConfig.getSoapuiWorkspace().getSettings() == null) {
workspaceConfig.getSoapuiWorkspace().addNewSettings();
}
setPath(file.getAbsolutePath());
settings = new XmlBeansSettingsImpl(this, SoapUI.getSettings(), workspaceConfig.getSoapuiWorkspace()
.getSettings());
boolean closeOnStartup = getSettings().getBoolean(UISettings.CLOSE_PROJECTS);
List<WorkspaceProjectConfig> projects = workspaceConfig.getSoapuiWorkspace().getProjectList();
for (WorkspaceProjectConfig wsc : projects) {
String str = PathUtils.denormalizePath(wsc.getStringValue());
str = PathUtils.adjustRelativePath(str, getProjectRoot(), this);
try {
WsdlProject project = (WsdlProject) ProjectFactoryRegistry.getProjectFactory("wsdl").createNew(str,
this, !closeOnStartup && wsc.getStatus() != Status.CLOSED && wsc.getType() != Type.REMOTE,
wsc.getName(), null);
projectList.add(project);
} catch (Exception e) {
UISupport.showErrorMessage(messages.get("FailedToLoadProjectInWorkspace", str) + e.getMessage());
SoapUI.logError(e);
}
}
} else {
workspaceConfig = SoapuiWorkspaceDocumentConfig.Factory.newInstance();
workspaceConfig.addNewSoapuiWorkspace().setName(messages.get("DefaultWorkspaceName"));
workspaceConfig.getSoapuiWorkspace().addNewSettings();
settings = new XmlBeansSettingsImpl(this, SoapUI.getSettings(), workspaceConfig.getSoapuiWorkspace()
.getSettings());
}
}