public WebsiteArchivator(string websiteRootPath, IGlobalInfo globalInfo, DirectoryHelper directoryHelper)
        {
            if (!Directory.Exists(websiteRootPath))
            {
                throw new InvalidOperationException($@"Указанная папка сайта {websiteRootPath} не существует");
            }

            _directoryHelper = directoryHelper
                               ?? throw new ArgumentNullException(paramName: nameof(directoryHelper));

            var websiteDirectoryRootPath = websiteRootPath;

            _siteDirectoryPath     = Path.Combine(websiteDirectoryRootPath, globalInfo.SiteFolderName());
            _archDirectoryRootPath = Path.Combine(websiteDirectoryRootPath, globalInfo.SiteArchiveFolderName());

            if (!Directory.Exists(_siteDirectoryPath))
            {
                throw new InvalidOperationException($@"Папки с прежними файлами сайта {_siteDirectoryPath} не сущестует");
            }

            if (!Directory.Exists(_archDirectoryRootPath))
            {
                Directory.CreateDirectory(_archDirectoryRootPath);
            }
        }
        private void ValidateSettings()
        {
            if (_parsedResult == null)
            {
                throw new InvalidOperationException(@"Сначала нужно разпарсить файл");
            }

            if (_parsedResult.Count == 0)
            {
                throw new InvalidOperationException(@"Файл настроек нод не содержит полезных данных");
            }

            for (var index = 0; index < _parsedResult.Count; index++)
            {
                WebsiteNodeData websiteNodeData  = _parsedResult[index];
                int             indexForMessages = index + 1;

                ThrowErrorIfEmptyValue(websiteNodeData.DisplayableName, indexForMessages, "Не указано имя ноды");

                ThrowErrorIfEmptyValue(websiteNodeData.ServerMachineName, indexForMessages,
                                       "Не указано имя сервера для остановки/запуска IIS");

                ThrowErrorIfEmptyValue(websiteNodeData.DeployDirectoryPath, indexForMessages,
                                       "Не указана папка деплоя, откуда будут копироваться файлы для сайта");

                ThrowErrorIfEmptyValue(websiteNodeData.WebsiteRootPath, indexForMessages,
                                       $"Не указан путь до корневой папки сайта, где лежат подпапки {_globalInfo.SiteArchiveFolderName()} и {_globalInfo.SiteFolderName()}");

                if (websiteNodeData.WebsiteUrls == null || websiteNodeData.WebsiteUrls.Count == 0)
                {
                    ThrowException(indexForMessages, "Не указаны урлы ноды");
                }
            }

            // Проверим, что ввели уникальные значения. Чтоб два раза какой-нибудь сайт не обновили

            CheckUniqueness(x => x.DisplayableName, $"Есть повторы по полю {nameof(WebsiteNodeData.DisplayableName)}");

            CheckUniqueness(x => x.WebsiteRootPath, $"Есть повторы по полю {nameof(WebsiteNodeData.WebsiteRootPath)}");
        }