コード例 #1
0
        private static IAmazonS3 GetS3Client(S3Options options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (options.KeyId == null)
            {
                throw new ArgumentNullException(nameof(options.KeyId));
            }

            if (options.SecretKey == null)
            {
                throw new ArgumentNullException(nameof(options.SecretKey));
            }

            if (options.Region == null)
            {
                throw new ArgumentNullException(nameof(options.Region));
            }

            return(new AmazonS3Client(options.KeyId, options.SecretKey, RegionEndpoint.GetBySystemName(options.Region)));
        }
コード例 #2
0
 public S3FileStorage(S3Options options) : this(GetS3Client(options), options.BucketName)
 {
     // No-op.
 }