C# Class Snowcode.S3BuildPublisher.S3.S3Helper

Helper class to connect to Amazon aws S3 and store files.
Inheritance: IDisposable
Show file Open project: BookSwapSteve/AWS-MSBuild-Task-Library Class Usage Examples

Public Methods

Method Description
CreateBucket ( string bucketName ) : void

Creates a S3 Bucket.

DeleteBucket ( string bucketName ) : void

Delete a S3 Bucket.

DeleteObject ( string bucketName, string key ) : void

Seletes an object from a S3 bucket.

Dispose ( ) : void
Publish ( string files, string bucketName, string folder, bool publicRead ) : void

Publish a file to a S3 bucket, in the folder specified, optionally making it publically readable.

PutFileObject ( string bucketName, string key, string file ) : void

Puts a file into a S3 bucket.

PutTextObject ( string bucketName, string key, string text ) : void

Creates a text object in the S3 bucket.

S3Helper ( AmazonS3 amazonS3Client ) : System
S3Helper ( Snowcode.S3BuildPublisher.Client.AwsClientDetails clientDetails ) : System
S3Helper ( string awsAccessKeyId, string awsSecretAccessKey ) : System
SetAcl ( string bucketName, string cannedACL, string key ) : void

Sets the ACL

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
CreateBucketIfNeeded ( string bucketName ) : void
GetDestinationFolder ( string folder ) : string
StoreFile ( string file, string key, string bucketName, bool publicRead ) : void
StoreFiles ( string files, string bucketName, string destinationFolder, bool publicRead ) : void

Method Details

CreateBucket() public method

Creates a S3 Bucket.
public CreateBucket ( string bucketName ) : void
bucketName string
return void

DeleteBucket() public method

Delete a S3 Bucket.
public DeleteBucket ( string bucketName ) : void
bucketName string
return void

DeleteObject() public method

Seletes an object from a S3 bucket.
public DeleteObject ( string bucketName, string key ) : void
bucketName string
key string
return void

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

Publish() public method

Publish a file to a S3 bucket, in the folder specified, optionally making it publically readable.
public Publish ( string files, string bucketName, string folder, bool publicRead ) : void
files string
bucketName string
folder string
publicRead bool
return void

PutFileObject() public method

Puts a file into a S3 bucket.
public PutFileObject ( string bucketName, string key, string file ) : void
bucketName string
key string
file string
return void

PutTextObject() public method

Creates a text object in the S3 bucket.
public PutTextObject ( string bucketName, string key, string text ) : void
bucketName string
key string
text string
return void

S3Helper() public method

public S3Helper ( AmazonS3 amazonS3Client ) : System
amazonS3Client AmazonS3
return System

S3Helper() public method

public S3Helper ( Snowcode.S3BuildPublisher.Client.AwsClientDetails clientDetails ) : System
clientDetails Snowcode.S3BuildPublisher.Client.AwsClientDetails
return System

S3Helper() public method

public S3Helper ( string awsAccessKeyId, string awsSecretAccessKey ) : System
awsAccessKeyId string
awsSecretAccessKey string
return System

SetAcl() public method

Sets the ACL
public SetAcl ( string bucketName, string cannedACL, string key ) : void
bucketName string
cannedACL string ACL to use, AuthenticatedRead, BucketOwnerFullControl, BucketOwnerRead, NoACL, Private, PublicRead, PublicReadWrite
key string
return void