if (workspaceNamesCorrespondMap == null)
{
for (String path : rblog.getWorkspaceBackupsInfo())
{
BackupChainLog bLog = new BackupChainLog(new File(path));
backups.put(bLog.getBackupConfig().getWorkspace(), bLog);
}
if (!rblog.getSystemWorkspace().equals(repositoryEntry.getSystemWorkspaceName()))
{
throw new BackupConfigurationException(
"The backup to system workspace is not system workspace in repository entry: "
+ rblog.getSystemWorkspace() + " is not equal " + repositoryEntry.getSystemWorkspaceName());
}
if (backups.size() != repositoryEntry.getWorkspaceEntries().size())
{
throw new BackupConfigurationException(
"The repository entry is contains more or less workspace entry than backups of workspace in "
+ rblog.getLogFilePath());
}
for (WorkspaceEntry wsEntry : repositoryEntry.getWorkspaceEntries())
{
if (!backups.containsKey(wsEntry.getName()))
{
throw new BackupConfigurationException("The workspace '" + wsEntry.getName()
+ "' is not found in backup " + rblog.getLogFilePath());
}
else
{
workspacesMapping.put(wsEntry.getName(), backups.get(wsEntry.getName()));
}
}
}
else
{
// Create map [new_ws_name : backupLog to that workspace].
for (String path : rblog.getWorkspaceBackupsInfo())
{
BackupChainLog bLog = new BackupChainLog(new File(path));
if (!workspaceNamesCorrespondMap.containsKey(bLog.getBackupConfig().getWorkspace()))
{
throw new BackupConfigurationException("Can not found coresptonding workspace name to workspace '"
+ bLog.getBackupConfig().getWorkspace() + "' in " + workspaceNamesCorrespondMap.keySet());
}
backups.put(workspaceNamesCorrespondMap.get(bLog.getBackupConfig().getWorkspace()), bLog);
}
// Checking system workspace.
if (!repositoryEntry.getSystemWorkspaceName().equals(
workspaceNamesCorrespondMap.get(rblog.getSystemWorkspace())))