FileCleanerHolder cleanerHolder =
(FileCleanerHolder)repositoryService.getRepository(this.repositoryEntry.getName())
.getWorkspaceContainer(wEntry.getName()).getComponent(FileCleanerHolder.class);
JCRRestore restorer = new JCRRestore(dataManager, cleanerHolder.getFileCleaner());
for (File incrBackupFile : JCRRestore.getIncrementalFiles(storageDir))
{
restorer.incrementalRestore(incrBackupFile);
}
}
}
catch (Throwable t) //NOSONAR
{
// rollback
for (DataRestore restorer : dataRestorer)
{
try
{
restorer.rollback();
}
catch (BackupException e)
{
LOG.error("Can't rollback changes", e);
}
}
throw new RepositoryRestoreExeption("Repository " + repositoryEntry.getName() + " was not restored", t);
}
finally
{
// close
for (DataRestore restorer : dataRestorer)
{
try
{
restorer.close();
}
catch (BackupException e)
{
LOG.error("Can't close restorer", e);
}