@@ -17,7 +17,7 @@ public class AwsSettings
17
17
/// Override the AWS S3 endpoint (if using non-Amazon storage), otherwise leave null.
18
18
/// Use the form http://localhost:8000/
19
19
/// </summary>
20
- public string Hostname { get ; set ; }
20
+ public string Endpoint { get ; set ; }
21
21
22
22
/// <summary>
23
23
/// Enable or disable SSL (only if using non-Amazon storage).
@@ -72,7 +72,7 @@ public AwsSettings(string accessKey, string secretKey, AwsRegion region, string
72
72
if ( String . IsNullOrEmpty ( accessKey ) ) throw new ArgumentNullException ( nameof ( accessKey ) ) ;
73
73
if ( String . IsNullOrEmpty ( secretKey ) ) throw new ArgumentNullException ( nameof ( secretKey ) ) ;
74
74
if ( String . IsNullOrEmpty ( bucket ) ) throw new ArgumentNullException ( nameof ( bucket ) ) ;
75
- Hostname = null ;
75
+ Endpoint = null ;
76
76
Ssl = true ;
77
77
AccessKey = accessKey ;
78
78
SecretKey = secretKey ;
@@ -114,7 +114,7 @@ public AwsSettings(string accessKey, string secretKey, AwsRegion region, string
114
114
if ( String . IsNullOrEmpty ( accessKey ) ) throw new ArgumentNullException ( nameof ( accessKey ) ) ;
115
115
if ( String . IsNullOrEmpty ( secretKey ) ) throw new ArgumentNullException ( nameof ( secretKey ) ) ;
116
116
if ( String . IsNullOrEmpty ( bucket ) ) throw new ArgumentNullException ( nameof ( bucket ) ) ;
117
- Hostname = null ;
117
+ Endpoint = null ;
118
118
Ssl = true ;
119
119
AccessKey = accessKey ;
120
120
SecretKey = secretKey ;
@@ -148,26 +148,51 @@ public AwsSettings(string accessKey, string secretKey, string region, string buc
148
148
/// <summary>
149
149
/// Initialize the object.
150
150
/// </summary>
151
- /// <param name="hostname ">Override the AWS S3 endpoint (if using non-Amazon storage). Use the form http://localhost:8000/.</param>
151
+ /// <param name="endpoint ">Override the AWS S3 endpoint (if using non-Amazon storage). Use the form http://localhost:8000/.</param>
152
152
/// <param name="ssl">Enable or disable SSL.</param>
153
153
/// <param name="accessKey">Access key with which to access AWS S3.</param>
154
154
/// <param name="secretKey">Secret key with which to access AWS S3.</param>
155
155
/// <param name="region">AWS region.</param>
156
156
/// <param name="bucket">Bucket in which to store BLOBs.</param>
157
- public AwsSettings ( string hostname , bool ssl , string accessKey , string secretKey , AwsRegion region , string bucket )
157
+ public AwsSettings ( string endpoint , bool ssl , string accessKey , string secretKey , AwsRegion region , string bucket )
158
158
{
159
- if ( String . IsNullOrEmpty ( hostname ) ) throw new ArgumentNullException ( nameof ( hostname ) ) ;
159
+ if ( String . IsNullOrEmpty ( endpoint ) ) throw new ArgumentNullException ( nameof ( endpoint ) ) ;
160
160
if ( String . IsNullOrEmpty ( accessKey ) ) throw new ArgumentNullException ( nameof ( accessKey ) ) ;
161
161
if ( String . IsNullOrEmpty ( secretKey ) ) throw new ArgumentNullException ( nameof ( secretKey ) ) ;
162
162
if ( String . IsNullOrEmpty ( bucket ) ) throw new ArgumentNullException ( nameof ( bucket ) ) ;
163
- Hostname = hostname ;
163
+ Endpoint = endpoint ;
164
164
Ssl = ssl ;
165
165
AccessKey = accessKey ;
166
166
SecretKey = secretKey ;
167
167
Region = region ;
168
168
Bucket = bucket ;
169
169
}
170
170
171
+ /// <summary>
172
+ /// Initialize the object.
173
+ /// </summary>
174
+ /// <param name="endpoint">Override the AWS S3 endpoint (if using non-Amazon storage). Use the form http://localhost:8000/.</param>
175
+ /// <param name="ssl">Enable or disable SSL.</param>
176
+ /// <param name="accessKey">Access key with which to access AWS S3.</param>
177
+ /// <param name="secretKey">Secret key with which to access AWS S3.</param>
178
+ /// <param name="region">AWS region.</param>
179
+ /// <param name="bucket">Bucket in which to store BLOBs.</param>
180
+ public AwsSettings ( string endpoint , bool ssl , string accessKey , string secretKey , string region , string bucket )
181
+ {
182
+ if ( String . IsNullOrEmpty ( endpoint ) ) throw new ArgumentNullException ( nameof ( endpoint ) ) ;
183
+ if ( String . IsNullOrEmpty ( accessKey ) ) throw new ArgumentNullException ( nameof ( accessKey ) ) ;
184
+ if ( String . IsNullOrEmpty ( secretKey ) ) throw new ArgumentNullException ( nameof ( secretKey ) ) ;
185
+ if ( String . IsNullOrEmpty ( bucket ) ) throw new ArgumentNullException ( nameof ( bucket ) ) ;
186
+ Endpoint = endpoint ;
187
+ Ssl = ssl ;
188
+ AccessKey = accessKey ;
189
+ SecretKey = secretKey ;
190
+ Bucket = bucket ;
191
+
192
+ if ( ! ValidateRegion ( region ) ) throw new ArgumentException ( "Unable to validate region: " + region ) ;
193
+ Region = GetRegionFromString ( region ) ;
194
+ }
195
+
171
196
#endregion
172
197
173
198
#region Public-Methods
0 commit comments