FileCleanerHolder fileCleanHolder =
(FileCleanerHolder)repositoryService.getRepository(repositoryName).getWorkspaceContainer(wEntry.getName())
.getComponent(FileCleanerHolder.class);
JCRRestor restorer = new JCRRestor(dataManager, fileCleanHolder.getFileCleaner());
for (File incrBackupFile : JCRRestor.getIncrementalFiles(storageDir))
{
restorer.incrementalRestore(incrBackupFile);
}
}
catch (Throwable t)
{
// rollback
for (DataRestor restorer : dataRestorer)
{
try
{
restorer.rollback();
}
catch (BackupException e)
{
log.error("Can't rollback changes", e);
}
}
throw new WorkspaceRestoreException("Workspace " + wEntry.getName() + " was not restored", t);
}
finally
{
// close
for (DataRestor restorer : dataRestorer)
{
try
{
restorer.close();
}
catch (BackupException e)
{
log.error("Can't close restorer", e);
}