if (repository.resourceExists(path)) {
// if the target already have resources, delete them..
repository.prepareVersionRestore(path);
}
versionRepository.restoreVersion(versionedResourcePath);
VersionedPath versionedPath =
RegistryUtils.getVersionedPath(versionedResourcePath);
if (context.isLoggingActivity()) {
registryContext.getLogWriter().addLog(
path, CurrentSession.getUser(), LogEntry.RESTORE,
Long.toString(versionedPath.getVersion()));
}
}
// transaction successfully finished
transactionSucceeded = true;