Twoorb Plugins  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Twoorb.AWS.NETAWSS3 Class Reference

Helper class to communicate with .NET S3 methods in the AWSSDK More...

Public Member Functions

void Initialize (string accessKey, string secretKey, EAWSRegion region, S3InitializeEventHandler onInitializeHandler)
 Initializes the Amazon S3 Client More...
 
void Close (S3CloseEventHandler onCloseHandler)
 Close and clean up this Amazon S3 instance More...
 
void CreateBucket (string bucketName, S3CreateBucketEventHandler onCreateBucketHandler)
 Creates a bucket in the specified region of the Amazon S3 Client(i.e. The EAWSRegion in the initialize method) More...
 
void DeleteBucket (string bucketName, S3DeleteBucketEventHandler onDeleteBucketHandler)
 Deletes a bucket with the specified name. The operation WILL try and delete ANY file that might still be in the bucket, because you cannot delete a bucket with objects still in it. More...
 
void DeleteFile (string bucketName, string objectName, S3DeleteFileEventHandler onDeleteObjectHandler)
 Deletes an object in the specified bucket. More...
 
void ListBuckets (S3ListBucketsEventHandler onListBucketsHandler)
 Gets a list of the available buckets in your amazon S3 account. More...
 
void ListObjectsInBucket (string bucketName, S3ListObjectsEventHandler onListObjectsHandler)
 Lists all the object keys in a specified bucket. More...
 
void ListObjectsInBucket (string bucketName, string searchPrefix, S3ListObjectsEventHandler onListObjectsHandler)
 Lists all the object keys in a specified bucket. More...
 
void DownloadFile (string bucketName, string key, string destinationPath, S3DownloadFileEventHandler onDownloadFileEventHandler)
 Downloads a file from the specified bucket with the specified key. More...
 
void DownloadDirectory (string bucketName, string s3DirectoryPath, string savePath, bool recursive, S3DownloadDirectoryEventHandler onDownloadDirectoryEventHandler)
 Downloads a complete directory from amazon s3 More...
 
void GetDownloadUrl (string bucketName, string key, int expiresInMinutes, S3GetDownloadUrlEventHandler onGetDownloadUrlHandler)
 Gets a presigned http url for a specific object that is valid for the specified amount of time. More...
 
void UploadFile (string bucketName, string filePath, string key, S3UploadFileEventHandler onUploadFileHandler)
 Uploads a file to the specified bucket. More...
 
void UploadDirectory (string bucketName, string uploadPath, string directoryPath, bool recursively, string searchPattern, S3UploadDirectoryEventHandler onUploadDirectoryHandler)
 Uploads a directory and all the files in it to the specified bucket. More...
 

Properties

IAmazonS3 Client [get]
 The IAmazonS3 Client More...
 
bool IsInitialized [get]
 Returns if the amazon client is initialized More...
 
Dictionary< string,
S3DownloadFileEventHandler >
.KeyCollection 
FileDownloadsInProgress [get]
 Returns a list of all the file downloads in progress More...
 
Dictionary< string,
S3UploadFileEventHandler >
.KeyCollection 
FileUploadsInProgress [get]
 Returns a list of all the file uploads in progress More...
 
Dictionary< string,
S3UploadDirectoryEventHandler >
.KeyCollection 
DirectoryUploadsInProgress [get]
 Returns a list of all the directory uploads in progress More...
 
Dictionary< string,
S3DownloadDirectoryEventHandler >
.KeyCollection 
DirectoryDownloadsInProgress [get]
 Returns a list of all the directory downloads in progress More...
 

Detailed Description

Helper class to communicate with .NET S3 methods in the AWSSDK

Member Function Documentation

void Twoorb.AWS.NETAWSS3.Close ( S3CloseEventHandler  onCloseHandler)

Close and clean up this Amazon S3 instance

Parameters
onCloseHandlerThe event handler that invokes when the Close operation is done.
void Twoorb.AWS.NETAWSS3.CreateBucket ( string  bucketName,
S3CreateBucketEventHandler  onCreateBucketHandler 
)

Creates a bucket in the specified region of the Amazon S3 Client(i.e. The EAWSRegion in the initialize method)

Parameters
bucketNameThe name of the bucket you want to create. Remember that this need to be a globally unique name
onCreateBucketHandlerThe event handler that invokes when the create bucket operation is done.
void Twoorb.AWS.NETAWSS3.DeleteBucket ( string  bucketName,
S3DeleteBucketEventHandler  onDeleteBucketHandler 
)

Deletes a bucket with the specified name. The operation WILL try and delete ANY file that might still be in the bucket, because you cannot delete a bucket with objects still in it.

Parameters
bucketNameThe name of the bucket you want to delete.
onDeleteBucketHandlerThe event handler that invokes when the delete bucket operation is done.
void Twoorb.AWS.NETAWSS3.DeleteFile ( string  bucketName,
string  objectName,
S3DeleteFileEventHandler  onDeleteObjectHandler 
)

Deletes an object in the specified bucket.

Parameters
bucketNameThe bucket in which the object resides
objectNameThe object key to delete
onDeleteObjectHandlerThe event handler that invokes when the delete object operation is done
void Twoorb.AWS.NETAWSS3.DownloadDirectory ( string  bucketName,
string  s3DirectoryPath,
string  savePath,
bool  recursive,
S3DownloadDirectoryEventHandler  onDownloadDirectoryEventHandler 
)

Downloads a complete directory from amazon s3

Parameters
bucketNameThe bucket to download the directory from
s3DirectoryPathThe directory to download from the s3 bucket
savePathThe destination path to store the downloaded directory
recursiveDo you want to upload all the files in all the subfolders or only the top level directory?
onDownloadDirectoryEventHandlerThe event handler that invokes when the download directory operation is done
void Twoorb.AWS.NETAWSS3.DownloadFile ( string  bucketName,
string  key,
string  destinationPath,
S3DownloadFileEventHandler  onDownloadFileEventHandler 
)

Downloads a file from the specified bucket with the specified key.

Parameters
bucketNameThe bucket to download the file from
keyThe unique key of the file to download
destinationPathThe destination path of the file to download.
onDownloadFileEventHandlerThe event handler that invokes when the download file operation is done.
void Twoorb.AWS.NETAWSS3.GetDownloadUrl ( string  bucketName,
string  key,
int  expiresInMinutes,
S3GetDownloadUrlEventHandler  onGetDownloadUrlHandler 
)

Gets a presigned http url for a specific object that is valid for the specified amount of time.

Parameters
bucketNameThe bucket that the object you want the url from is in
keyThe key of the object
expiresInMinutesThe amount of minutes from now that the url will be valid.
onGetDownloadUrlHandlerThe event handler that invokes when the get download URL operation is done. Returns the url upon success.
void Twoorb.AWS.NETAWSS3.Initialize ( string  accessKey,
string  secretKey,
EAWSRegion  region,
S3InitializeEventHandler  onInitializeHandler 
)

Initializes the Amazon S3 Client

Parameters
accessKeyThe AWS:S3 access key
secretKeyThe AWS:S3 secret key
regionThe server region of this instance. EAWSRegion.USEast1 is default
onInitializeHandlerThe event handler that invokes when the Initialize operation is done.
void Twoorb.AWS.NETAWSS3.ListBuckets ( S3ListBucketsEventHandler  onListBucketsHandler)

Gets a list of the available buckets in your amazon S3 account.

Parameters
onListBucketsHandlerThe event handler that invokes when the list buckets operation is done. Returns a list of bucket names if successful.
void Twoorb.AWS.NETAWSS3.ListObjectsInBucket ( string  bucketName,
S3ListObjectsEventHandler  onListObjectsHandler 
)

Lists all the object keys in a specified bucket.

Parameters
bucketNameThe name of the bucket to list objects in
onListObjectsHandlerThe event handler that invokes when the list objects in bucket operation is done. Returns a list with keys upon success
void Twoorb.AWS.NETAWSS3.ListObjectsInBucket ( string  bucketName,
string  searchPrefix,
S3ListObjectsEventHandler  onListObjectsHandler 
)

Lists all the object keys in a specified bucket.

Parameters
bucketNameThe name of the bucket to list objects in
searchPrefixA specified search prefix if you want to filter the search of objects
onListObjectsHandlerThe event handler that invokes when the list objects in bucket operation is done. Returns a list with keys upon success
void Twoorb.AWS.NETAWSS3.UploadDirectory ( string  bucketName,
string  uploadPath,
string  directoryPath,
bool  recursively,
string  searchPattern,
S3UploadDirectoryEventHandler  onUploadDirectoryHandler 
)

Uploads a directory and all the files in it to the specified bucket.

Parameters
bucketNameThe name of the bucket to upload the directory to
uploadPathThe path in the bucket that you want the folder to be uploaded to. (A key prefix to the files)
directoryPathThe path to the directory you want to upload
recursivelyDo you want to upload all the files in all the subfolders or only the top level directory?
searchPatternSpecify a search pattern in the directory to exclude certain files.
onUploadDirectoryHandlerThe event handler that invokes when the upload directory operation is done.
void Twoorb.AWS.NETAWSS3.UploadFile ( string  bucketName,
string  filePath,
string  key,
S3UploadFileEventHandler  onUploadFileHandler 
)

Uploads a file to the specified bucket.

Parameters
bucketNameThe name of the bucket to upload the file to
filePathThe file path to the file you want to upload
keyThe key you want the uploaded object to have once uploaded.
onUploadFileHandlerThe event handler that invokes when the upload file operation is done.

Property Documentation

IAmazonS3 Twoorb.AWS.NETAWSS3.Client
get

The IAmazonS3 Client

Dictionary<string, S3DownloadDirectoryEventHandler>.KeyCollection Twoorb.AWS.NETAWSS3.DirectoryDownloadsInProgress
get

Returns a list of all the directory downloads in progress

Dictionary<string, S3UploadDirectoryEventHandler>.KeyCollection Twoorb.AWS.NETAWSS3.DirectoryUploadsInProgress
get

Returns a list of all the directory uploads in progress

Dictionary<string, S3DownloadFileEventHandler>.KeyCollection Twoorb.AWS.NETAWSS3.FileDownloadsInProgress
get

Returns a list of all the file downloads in progress

Dictionary<string, S3UploadFileEventHandler>.KeyCollection Twoorb.AWS.NETAWSS3.FileUploadsInProgress
get

Returns a list of all the file uploads in progress

bool Twoorb.AWS.NETAWSS3.IsInitialized
get

Returns if the amazon client is initialized


The documentation for this class was generated from the following file: