LitS3.S3Service.CreateBucket C# (CSharp) Method

CreateBucket() public method

Creates a bucket in the default storage location automatically determined by Amazon.
public CreateBucket ( string bucketName ) : void
bucketName string The name of the bucket, which will be checked against /// the BucketNameChecking.Strict requirements.
return void
        public void CreateBucket(string bucketName)
        {
            new CreateBucketRequest(this, bucketName, false).GetResponse().Close();
        }

Usage Example

Example #1
0
        public S3Store()
        {
            _S3Service = new S3Service()
            {
                AccessKeyID = System.Environment.GetEnvironmentVariable("AMAZON_ACCESS_KEY_ID"),
                SecretAccessKey = System.Environment.GetEnvironmentVariable("AMAZON_SECRET_ACCESS_KEY")
            };

            if (_S3Service.QueryBucket(_bucketName) == BucketAccess.NoSuchBucket)
                _S3Service.CreateBucket(_bucketName);
        }