AlarmWorkflow.AlarmSource.Fax.FaxAlarmSource.EnsureDirectoriesExist C# (CSharp) Метод

EnsureDirectoriesExist() приватный Метод

Makes sure that the required directories exist and we don't run into unnecessary exceptions.
private EnsureDirectoriesExist ( ) : void
Результат void
        private void EnsureDirectoriesExist()
        {
            try
            {
                _faxPath.Refresh();
                _archivePath.Refresh();
                _analysisPath.Refresh();

                if (!_faxPath.Exists)
                {
                    _faxPath.Create();
                    Logger.Instance.LogFormat(LogType.Trace, this, Properties.Resources.CreatedRequiredDirectory, _faxPath.FullName);
                }
                if (!_archivePath.Exists)
                {
                    Logger.Instance.LogFormat(LogType.Trace, this, Properties.Resources.CreatedRequiredDirectory, _archivePath.FullName);
                    _archivePath.Create();
                }
                if (!_analysisPath.Exists)
                {
                    Logger.Instance.LogFormat(LogType.Trace, this, Properties.Resources.CreatedRequiredDirectory, _analysisPath.FullName);
                    _analysisPath.Create();
                }
            }
            catch (IOException)
            {
                Logger.Instance.LogFormat(LogType.Warning, this, Properties.Resources.ErrorCreatingRequiredDirectory);
            }
        }