FileCleanerHolder fileCleanHolder =
(FileCleanerHolder)repositoryService.getRepository(repositoryName).getWorkspaceContainer(wEntry.getName())
.getComponent(FileCleanerHolder.class);
JCRRestore restorer = new JCRRestore(dataManager, fileCleanHolder.getFileCleaner());
for (File incrBackupFile : JCRRestore.getIncrementalFiles(storageDir))
{
restorer.incrementalRestore(incrBackupFile);
}
}
catch (Throwable t)
{
// rollback
for (DataRestore 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 (DataRestore restorer : dataRestorer)
{
try
{
restorer.close();
}
catch (BackupException e)
{
log.error("Can't close restorer", e);
}