コード例 #1
0
        private static void RunUploaderBackwardCompatibilityTasks()
        {
            if (UploadersConfig.IsUpgradeFrom("11.6.0"))
            {
                if (UploadersConfig.DropboxURLType == DropboxURLType.Direct)
                {
                    UploadersConfig.DropboxUseDirectLink = true;
                }

                if (!string.IsNullOrEmpty(UploadersConfig.AmazonS3Settings.Endpoint))
                {
                    bool endpointFound = false;

                    foreach (AmazonS3Endpoint endpoint in AmazonS3.Endpoints)
                    {
                        if (endpoint.Region.Equals(UploadersConfig.AmazonS3Settings.Endpoint, StringComparison.InvariantCultureIgnoreCase))
                        {
                            UploadersConfig.AmazonS3Settings.Endpoint = endpoint.Endpoint;
                            UploadersConfig.AmazonS3Settings.Region   = endpoint.Region;
                            endpointFound = true;
                            break;
                        }
                    }

                    if (!endpointFound)
                    {
                        UploadersConfig.AmazonS3Settings.Endpoint = "";
                    }
                }
            }
        }
コード例 #2
0
 private static void RunUploaderBackwardCompatibilityTasks()
 {
     if (UploadersConfig.IsUpgradeFrom("11.6.0"))
     {
         if (!string.IsNullOrEmpty(UploadersConfig.AmazonS3Settings.Endpoint) && string.IsNullOrEmpty(UploadersConfig.AmazonS3Settings.RegionHostname) &&
             string.IsNullOrEmpty(UploadersConfig.AmazonS3Settings.RegionIdentifier))
         {
             foreach (AmazonS3Region region in AmazonS3.Regions)
             {
                 if (region.Identifier.Equals(UploadersConfig.AmazonS3Settings.Endpoint, StringComparison.InvariantCultureIgnoreCase))
                 {
                     UploadersConfig.AmazonS3Settings.RegionHostname   = region.Hostname;
                     UploadersConfig.AmazonS3Settings.RegionIdentifier = region.Identifier;
                     break;
                 }
             }
         }
     }
 }