*
* @throws RegistryException if the operation failed.
*/
public void restoreVersion(ResourcePath resourcePath) throws RegistryException {
VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
if (versionedPath.getVersion() == -1) {
String msg = "Failed to restore resource. " +
versionedPath + " is not a valid version path.";
log.error(msg);
throw new RegistryException(msg);
}
String versionedResourcePath = versionedPath.getPath();
long snapshotID = versionedPath.getVersion();
ResourceIDImpl resourceID = resourceDAO.getResourceID(versionedResourcePath);
if (!AuthorizationUtils.authorize(versionedResourcePath, ActionConstants.PUT)) {
String msg = "User " + CurrentSession.getUser() + " is not authorized to " +