}
private WorkspaceEntry getWorkspaceEntry(BackupConfig config,
RepositoryServiceConfiguration repositoryServiceConfiguration) throws BackupOperationException
{
RepositoryEntry repository = null;
try
{
repository = repositoryServiceConfiguration.getRepositoryConfiguration(config.getRepository());
}
catch (RepositoryConfigurationException e)
{
throw new BackupOperationException("Can not get repository \"" + config.getRepository() + "\"", e);
}
WorkspaceEntry wEntry = null;
for (WorkspaceEntry entry : repository.getWorkspaceEntries())
{
if (entry.getName().equals(config.getWorkspace()))
{
wEntry = entry;
break;
}
}
if (wEntry == null)
{
throw new BackupOperationException("Worksapce \"" + config.getWorkspace()
+ "\" was not exsisted in repository \"" + repository.getName() + "\".");
}
return wEntry;
}