public override S3FileStorageOptions Build()
        {
            if (String.IsNullOrEmpty(Target.ConnectionString))
            {
                return(Target);
            }

            var connectionString = new S3FileStorageConnectionStringBuilder(Target.ConnectionString);

            if (Target.Credentials == null)
            {
                Target.Credentials = connectionString.GetCredentials();
            }

            if (Target.Region == null)
            {
                Target.Region = connectionString.GetRegion();
            }

            if (String.IsNullOrEmpty(Target.Bucket) && !String.IsNullOrEmpty(connectionString.Bucket))
            {
                Target.Bucket = connectionString.Bucket;
            }

            return(Target);
        }
Exemple #2
0
        public override S3FileStorageOptions Build()
        {
            if (String.IsNullOrEmpty(Target.ConnectionString))
            {
                return(Target);
            }

            var connectionString = new S3FileStorageConnectionStringBuilder(Target.ConnectionString);

            if (Target.Credentials == null)
            {
                Target.Credentials = connectionString.GetCredentials();
            }

            if (Target.Region == null)
            {
                Target.Region = connectionString.GetRegion();
            }

            if (String.IsNullOrEmpty(Target.Bucket) && !String.IsNullOrEmpty(connectionString.Bucket))
            {
                Target.Bucket = connectionString.Bucket;
            }

            if (Target.UseChunkEncoding == null && connectionString.UseChunkEncoding != null)
            {
                Target.UseChunkEncoding = connectionString.UseChunkEncoding;
            }

            if (String.IsNullOrEmpty(Target.ServiceUrl) && !String.IsNullOrEmpty(connectionString.ServiceUrl))
            {
                Target.ServiceUrl = connectionString.ServiceUrl;
            }

            if (Target.CannedACL == null && connectionString.CannedACL != null)
            {
                Target.CannedACL = connectionString.CannedACL;
            }

            return(Target);
        }