示例#1
0
        public BucketFileSystem(
            string bucketName,
            string bucketHostName,
            string bucketKeyPrefix,
            string region,
            string cannedACL,
            string serverSideEncryptionMethod)
        {
            if (string.IsNullOrEmpty(bucketName))
            {
                throw new ArgumentNullException("bucketName");
            }

            BucketName     = bucketName;
            BucketHostName = BucketExtensions.ParseBucketHostName(bucketHostName);
            BucketPrefix   = BucketExtensions.ParseBucketPrefix(bucketKeyPrefix);

            ServerSideEncryptionMethod = EncryptionExtensions.ParseServerSideEncryptionMethod(serverSideEncryptionMethod);

            ACL = AclExtensions.ParseCannedAcl(cannedACL);

            var regionEndpoint = RegionEndpoint.GetBySystemName(region);

            ClientFactory    = () => new AmazonS3Client(regionEndpoint);
            LogHelper        = new LogHelperWrapper();
            MimeTypeResolver = new DefaultMimeTypeResolver();
        }
        public BucketFileSystem(
            string bucketName,
            string bucketHostName,
            string bucketKeyPrefix,
            string region)
        {
            if (string.IsNullOrEmpty(bucketName))
            {
                throw new ArgumentNullException("bucketName");
            }

            BucketName     = bucketName;
            BucketHostName = BucketExtensions.ParseBucketHostName(bucketHostName);
            BucketPrefix   = BucketExtensions.ParseBucketPrefix(bucketKeyPrefix);

            var regionEndpoint = RegionEndpoint.GetBySystemName(region);

            ClientFactory    = () => new AmazonS3Client(regionEndpoint);
            LogHelper        = new LogHelperWrapper();
            MimeTypeResolver = new DefaultMimeTypeResolver();
        }