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

A runtime utility class for the AmazonS3 service to make it easier to use its features. If you need to communicate with AmazonS3 in the editor instead of at runtime, we recommend that you use the NETAWSS3 class. More...

Inheritance diagram for Twoorb.AWS.AmazonS3Utility:

Public Member Functions

void Initialize (string accessKey, string secretKey, EAWSRegion region)
 Initializes the AmazonS3Utility class More...
 
void Close ()
 Closes the AmazonS3Utility class More...
 
void ListBuckets (S3ListBucketsEventHandler onListBucketsHandler)
 Lists all the buckets available in the selected region More...
 
void CreateBucket (string bucketName, S3CreateBucketEventHandler onCreateBucketHandler)
 Create a bucket More...
 
void DeleteFile (string bucketName, string objectName, S3DeleteFileEventHandler onDeleteObjectHandler)
 Delete a file in a bucket. More...
 
void DeleteBucket (string bucketName, S3DeleteBucketEventHandler onDeleteBucketHandler)
 Delete a bucket More...
 
void ListObjectsInBucket (string bucketName, S3ListObjectsEventHandler onListObjectsHandler)
 List all the objects in a bucket. More...
 
void ListObjectsInBucket (string bucketName, string searchPrefix, S3ListObjectsEventHandler onListObjectsHandler)
 List all the objects in a bucket. More...
 
void UploadFile (string bucketName, string filePath, string key, S3UploadFileEventHandler onUploadFileHandler)
 Uploads a file to the bucket More...
 
void UploadDirectory (string bucketName, string uploadPath, string directoryPath, bool recursively, string searchPattern, S3UploadDirectoryEventHandler onUploadDirectoryHandler)
 Uploads a directory to a bucket More...
 
void DownloadDirectory (string bucketName, string s3DirectoryPath, string savePath, bool recursive, S3DownloadDirectoryEventHandler onDownloadDirectoryEventHandler)
 Downloads a directory from a bucket More...
 
void DownloadFile (string bucketName, string key, string destinationPath, S3DownloadFileEventHandler onDownloadFileEventHandler)
 Download a file from a bucket. More...
 
void GetDownloadUrl (string bucketName, string key, int expiresInMinutes, S3GetDownloadUrlEventHandler onGetDownloadUrlHandler)
 Gets a pre-signed url for access to a file with given key. The URL will be valid for the value "expiresInMinutes", from the time calling this method. More...
 

Properties

IAmazonS3 Client [get]
 The IAmazonS3 client that the utility is using. Use this class if you want to use some of the methods of AmazonS3 currently not supported in the AmazonS3Utility class. More...
 
bool IsInitialized [get]
 Returns if the AmazonS3Utility class is Initialized. More...
 
EAmazonS3State CurrentState [get]
 Gets the current state of the AmazonS3Utility class More...
 
IEnumerable< string > FileDownloadsInProgress [get]
 Returns a list of all the files currently downloading using the AmazonS3Utility class. Returns null if the AmazonS3Utility class isn't initialized. More...
 
IEnumerable< string > FileUploadsInProgress [get]
 Returns a list of all the files currently uploading using the AmazonS3Utility class. Returns null if the AmazonS3Utility class isn't initialized. More...
 
IEnumerable< string > DirectoryUploadsInProgress [get]
 Returns a list of all the directories currently uploading using the AmazonS3Utility class. Returns null if the AmazonS3Utility class isn't initalized. More...
 
IEnumerable< string > DirectoryDownloadsInProgress [get]
 Returns a list of all the directories currently downloading using the AmazonS3Utility class. Returns null if the AmazonS3Utility class isn't initalized. More...
 

Detailed Description

A runtime utility class for the AmazonS3 service to make it easier to use its features. If you need to communicate with AmazonS3 in the editor instead of at runtime, we recommend that you use the NETAWSS3 class.

Member Function Documentation

void Twoorb.AWS.AmazonS3Utility.Close ( )

Closes the AmazonS3Utility class

void Twoorb.AWS.AmazonS3Utility.CreateBucket ( string  bucketName,
S3CreateBucketEventHandler  onCreateBucketHandler 
)

Create a bucket

Parameters
bucketNameThe name of the bucket to create
onCreateBucketHandlerCallback returning if the operation was a success along with the name of the created bucket.
void Twoorb.AWS.AmazonS3Utility.DeleteBucket ( string  bucketName,
S3DeleteBucketEventHandler  onDeleteBucketHandler 
)

Delete a bucket

Parameters
bucketNameThe bucket to delete
onDeleteBucketHandlerCallback returning if the bucket was deleted successfully
void Twoorb.AWS.AmazonS3Utility.DeleteFile ( string  bucketName,
string  objectName,
S3DeleteFileEventHandler  onDeleteObjectHandler 
)

Delete a file in a bucket.

Parameters
bucketNameThe bucket name where the file resides
objectNameThe key of the object to delete
onDeleteObjectHandlerCallback returning if the file was deleted successfully
void Twoorb.AWS.AmazonS3Utility.DownloadDirectory ( string  bucketName,
string  s3DirectoryPath,
string  savePath,
bool  recursive,
S3DownloadDirectoryEventHandler  onDownloadDirectoryEventHandler 
)

Downloads a directory from a bucket

Parameters
bucketNameThe name of the bucket to download the directory from
s3DirectoryPathThe directory path inside the bucket
savePathWhere to save the downloaded directory
recursiveIf you want to include all the subfolders and files in the directory
onDownloadDirectoryEventHandlerCallback returning the success status of the operation
void Twoorb.AWS.AmazonS3Utility.DownloadFile ( string  bucketName,
string  key,
string  destinationPath,
S3DownloadFileEventHandler  onDownloadFileEventHandler 
)

Download a file from a bucket.

Parameters
bucketNameThe bucket to download the file from
keyThe key of the file to download.
destinationPathThe destination path where you want the file to be saved.
onDownloadFileEventHandlerCallback returning the success status of the operation
void Twoorb.AWS.AmazonS3Utility.GetDownloadUrl ( string  bucketName,
string  key,
int  expiresInMinutes,
S3GetDownloadUrlEventHandler  onGetDownloadUrlHandler 
)

Gets a pre-signed url for access to a file with given key. The URL will be valid for the value "expiresInMinutes", from the time calling this method.

Parameters
bucketNameThe name of the bucket where the file resides
keyThe key of the file in the bucket
expiresInMinutesHow long in minutes that the URL is valid
onGetDownloadUrlHandlerCallback returning the success status of the operation along with the signed URL
void Twoorb.AWS.AmazonS3Utility.Initialize ( string  accessKey,
string  secretKey,
EAWSRegion  region 
)

Initializes the AmazonS3Utility class

Parameters
accessKeyThe access key to your AWS account
secretKeyThe secret key to your AWS account
regionThe region you want to operate in.
void Twoorb.AWS.AmazonS3Utility.ListBuckets ( S3ListBucketsEventHandler  onListBucketsHandler)

Lists all the buckets available in the selected region

Parameters
onListBucketsHandlerCallback returning if the operation was a success along with a list of bucket names
void Twoorb.AWS.AmazonS3Utility.ListObjectsInBucket ( string  bucketName,
S3ListObjectsEventHandler  onListObjectsHandler 
)

List all the objects in a bucket.

Parameters
bucketNameThe name of the bucket to list objects in
onListObjectsHandlerCallback returning if the list operation was successful along with a list of all the objects in the bucket.
void Twoorb.AWS.AmazonS3Utility.ListObjectsInBucket ( string  bucketName,
string  searchPrefix,
S3ListObjectsEventHandler  onListObjectsHandler 
)

List all the objects in a bucket.

Parameters
bucketNameThe name of the bucket to list objects in
searchPrefixSearch prefix is the option to filter the search. If you only want to list objects in a specific folder, you set the folder name here to be added as a prefix to the search.
onListObjectsHandlerCallback returning if the list operation was successful along with a list of all the objects in the bucket.
void Twoorb.AWS.AmazonS3Utility.UploadDirectory ( string  bucketName,
string  uploadPath,
string  directoryPath,
bool  recursively,
string  searchPattern,
S3UploadDirectoryEventHandler  onUploadDirectoryHandler 
)

Uploads a directory to a bucket

Parameters
bucketNameThe name of the bucket to upload the directory in
uploadPathWhere to upload the directory in the bucket.
directoryPathThe path on your device where the directory resides
recursivelyIf you want to include all the subfolders and files in the directory
searchPatternSearch prefix is the option to filter the search. If you only want to list objects in a specific folder, you set the folder name here to be added as a prefix to the search.
onUploadDirectoryHandlerCallback returning the success status of the operation
void Twoorb.AWS.AmazonS3Utility.UploadFile ( string  bucketName,
string  filePath,
string  key,
S3UploadFileEventHandler  onUploadFileHandler 
)

Uploads a file to the bucket

Parameters
bucketNameThe name of the bucket to upload the file in
filePathThe path on your device where the file to upload resides.
keySpecify what key the file will have once uploaded
onUploadFileHandlerCallback returning the success of the operation

Property Documentation

IAmazonS3 Twoorb.AWS.AmazonS3Utility.Client
get

The IAmazonS3 client that the utility is using. Use this class if you want to use some of the methods of AmazonS3 currently not supported in the AmazonS3Utility class.

Only use this if you know what you are doing.

Returns null if the AmazonS3Utility class isn't Initialized

EAmazonS3State Twoorb.AWS.AmazonS3Utility.CurrentState
get

Gets the current state of the AmazonS3Utility class

IEnumerable<string> Twoorb.AWS.AmazonS3Utility.DirectoryDownloadsInProgress
get

Returns a list of all the directories currently downloading using the AmazonS3Utility class. Returns null if the AmazonS3Utility class isn't initalized.

IEnumerable<string> Twoorb.AWS.AmazonS3Utility.DirectoryUploadsInProgress
get

Returns a list of all the directories currently uploading using the AmazonS3Utility class. Returns null if the AmazonS3Utility class isn't initalized.

IEnumerable<string> Twoorb.AWS.AmazonS3Utility.FileDownloadsInProgress
get

Returns a list of all the files currently downloading using the AmazonS3Utility class. Returns null if the AmazonS3Utility class isn't initialized.

IEnumerable<string> Twoorb.AWS.AmazonS3Utility.FileUploadsInProgress
get

Returns a list of all the files currently uploading using the AmazonS3Utility class. Returns null if the AmazonS3Utility class isn't initialized.

bool Twoorb.AWS.AmazonS3Utility.IsInitialized
get

Returns if the AmazonS3Utility class is Initialized.


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