Beispiel #1
0
        public static FtpSite GetFtpSite(ManagementConfigurationPath configPath, ServerManager serverManager)
        {
            FtpSite ftpSiteDefaultElement = null;

            if (configPath.PathType == ConfigurationPathType.Server)
            {
                ftpSiteDefaultElement = GetFtpSiteDefaultElement(serverManager.SiteDefaults);
            }
            else
            {
                Site site = serverManager.Sites[configPath.SiteName];
                if (site == null)
                {
                    WebManagementServiceException exception = new WebManagementServiceException("GetSettingsExceptionError", string.Empty);
                    throw exception;
                }
                if (!IsFtpSite(site))
                {
                    WebManagementServiceException exception2 = new WebManagementServiceException("SiteIsNotFtpSiteExceptionError", string.Empty);
                    throw exception2;
                }
                ftpSiteDefaultElement = GetFtpSiteElement(site);
            }
            if (ftpSiteDefaultElement == null)
            {
                WebManagementServiceException exception3 = new WebManagementServiceException("GetSettingsExceptionError", string.Empty);
                throw exception3;
            }
            return(ftpSiteDefaultElement);
        }
Beispiel #2
0
 public static FtpSite GetFtpSite(ManagementConfigurationPath configPath, ServerManager serverManager)
 {
     FtpSite ftpSiteDefaultElement = null;
     if (configPath.PathType == ConfigurationPathType.Server)
     {
         ftpSiteDefaultElement = GetFtpSiteDefaultElement(serverManager.SiteDefaults);
     }
     else
     {
         Site site = serverManager.Sites[configPath.SiteName];
         if (site == null)
         {
             WebManagementServiceException exception = new WebManagementServiceException("GetSettingsExceptionError", string.Empty);
             throw exception;
         }
         if (!IsFtpSite(site))
         {
             WebManagementServiceException exception2 = new WebManagementServiceException("SiteIsNotFtpSiteExceptionError", string.Empty);
             throw exception2;
         }
         ftpSiteDefaultElement = GetFtpSiteElement(site);
     }
     if (ftpSiteDefaultElement == null)
     {
         WebManagementServiceException exception3 = new WebManagementServiceException("GetSettingsExceptionError", string.Empty);
         throw exception3;
     }
     return ftpSiteDefaultElement;
 }