Orc.NuGetExplorer.BackupFileSystemService.Restore C# (CSharp) Method

Restore() public method

public Restore ( string fullPath ) : void
fullPath string
return void
        public void Restore(string fullPath)
        {
            Log.Info("Restoring backup for {0}", fullPath);

            try
            {
                var parentDirectory = Catel.IO.Path.GetParentDirectory(fullPath);
                var directoryName = Catel.IO.Path.GetRelativePath(fullPath, parentDirectory);
                var sourceDirectory = _operationContextService.CurrentContext.FileSystemContext.GetDirectory(directoryName);

                _fileSystemService.CopyDirectory(sourceDirectory, fullPath);
            }
            catch (Exception exception)
            {
                Log.Error(exception, "Failed to restore backup for {0}", fullPath);
            }
        }
        #endregion