{
for (WorkspaceEntry we : repositoryEntry.getWorkspaceEntries())
{
if (!we.getName().equals(workspaceEntry.getName()))
{
WorkspaceContainerFacade wsContainer = repository.getWorkspaceContainer(we.getName());
wsContainer.setState(ManageableRepository.SUSPENDED);
workspacesWaits4Resume.add(wsContainer);
}
}
}
DataRestoreContext context = new DataRestoreContext(
new String[] {DataRestoreContext.STORAGE_DIR},
new Object[] {new File(restorePath)});
// restore all components
for (Backupable component : backupableComponents)
{
dataRestorers.add(component.getDataRestorer(context));
}
for (DataRestore restorer : dataRestorers)
{
restorer.clean();
}
for (DataRestore restorer : dataRestorers)
{
restorer.restore();
}
for (DataRestore restorer : dataRestorers)
{
restorer.commit();
}
}
catch (Throwable e)
{
throwable = e;
for (DataRestore restorer : dataRestorers)
{
try
{
restorer.rollback();
}
catch (BackupException e1)
{
log.error("Can't rollback restorer", e);
}
}
throw new RepositoryException(e);
}
finally
{
for (DataRestore restorer : dataRestorers)
{
try
{
restorer.close();
}
catch (BackupException e)
{
log.error("Can't close restorer", e);
}
}
try
{
for (WorkspaceContainerFacade wsContainer : workspacesWaits4Resume)
{
wsContainer.setState(ManageableRepository.ONLINE);
}
}
catch (RepositoryException e)
{
if (throwable == null)