BetterCms.Core.Services.Storage.FtpStorageService.FtpStorageService C# (CSharp) Метод

FtpStorageService() публичный Метод

public FtpStorageService ( ICmsConfiguration config ) : System
config ICmsConfiguration
Результат System
        public FtpStorageService(ICmsConfiguration config)
        {
            try
            {
                var serviceSection = config.Storage;
                var mode = serviceSection.GetValue("UsePassiveMode");

                rootUrl = config.Storage.ContentRoot;
                usePassiveMode = mode != null && bool.Parse(mode);
                ftpRoot = serviceSection.GetValue("FtpRoot");
                userName = serviceSection.GetValue("FtpUserName");
                password = serviceSection.GetValue("FtpPassword");

                if (string.IsNullOrEmpty(rootUrl))
                {
                    throw new StorageException("ContentRoot is missing in a storage configuration.");
                }

                rootUrl = rootUrl.TrimEnd('/');
            }
            catch (Exception e)
            {
                throw new StorageException(string.Format("Failed to initialize storage service {0}.", GetType()), e);
            }
        }