Twoorb Plugins  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Amazon.S3.Transfer.TransferUtility Class Reference

More...

Inheritance diagram for Amazon.S3.Transfer.TransferUtility:

Public Member Functions

 TransferUtility ()
 Constructs a new TransferUtility class. More...
 
 TransferUtility (RegionEndpoint region)
 Constructs a new TransferUtility class. More...
 
 TransferUtility (string awsAccessKeyId, string awsSecretAccessKey)
 Constructs a new TransferUtility class. More...
 
 TransferUtility (string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
 Constructs a new TransferUtility class. More...
 
 TransferUtility (string awsAccessKeyId, string awsSecretAccessKey, TransferUtilityConfig config)
 Constructs a new instance of the TransferUtility class. More...
 
 TransferUtility (string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region, TransferUtilityConfig config)
 Constructs a new instance of the TransferUtility class. More...
 
 TransferUtility (IAmazonS3 s3Client)
 Constructs a new instance of the TransferUtility class. More...
 
 TransferUtility (IAmazonS3 s3Client, TransferUtilityConfig config)
 Initializes a new instance of the TransferUtility class. More...
 
void Dispose ()
 Disposes of all managed and unmanaged resources. More...
 
void UploadDirectory (string directory, string bucketName, Action< bool > onDone=null)
 Uploads files from a specified directory. The object key is derived from the file names inside the directory. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3. More...
 
void UploadDirectory (string directory, string bucketName, string searchPattern, SearchOption searchOption, Action< bool > onDone=null)
 Uploads files from a specified directory. The object key is derived from the file names inside the directory. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3. More...
 
void UploadDirectory (TransferUtilityUploadDirectoryRequest request, Action< bool > onDone=null)
 Uploads files from a specified directory. The object key is derived from the file names inside the directory. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3. More...
 
void Upload (string filePath, string bucketName, Action< bool > onDone=null)
 Uploads the specified file. The object key is derived from the file's name. Multiple threads are used to read the file and perform multiple uploads in parallel. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3. More...
 
void Upload (string filePath, string bucketName, string key, Action< bool > onDone=null)
 Uploads the specified file. Multiple threads are used to read the file and perform multiple uploads in parallel. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3. More...
 
void Upload (Stream stream, string bucketName, string key, Action< bool > onDone=null)
 Uploads the contents of the specified stream. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3. More...
 
void Upload (TransferUtilityUploadRequest request, Action< bool > onDone=null)
 Uploads the file or stream specified by the request. To track the progress of the upload, add an event listener to the request's UploadProgressEvent. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3. More...
 
Stream OpenStream (string bucketName, string key, Action< bool > onDone=null)
 Returns a stream from which the caller can read the content from the specified Amazon S3 bucket and key. The caller of this method is responsible for closing the stream. More...
 
Stream OpenStream (TransferUtilityOpenStreamRequest request, Action< bool > onDone=null)
 Returns a stream to read the contents from Amazon S3 as specified by the TransferUtilityOpenStreamRequest. The caller of this method is responsible for closing the stream. More...
 
void Download (string filePath, string bucketName, string key, Action< bool > onDone=null)
 Downloads the content from Amazon S3 and writes it to the specified file. The object key is derived from the file name. More...
 
void Download (TransferUtilityDownloadRequest request, Action< bool > onDone=null)
 Downloads the content from Amazon S3 and writes it to the specified file. If the key is not specified in the request parameter, the file name will used as the key name. More...
 
void DownloadDirectory (string bucketName, string s3Directory, string localDirectory, Action< bool > onDone=null)
 Downloads the objects in Amazon S3 that have a key that starts with the value specified by s3Directory. More...
 
void DownloadDirectory (TransferUtilityDownloadDirectoryRequest request, Action< bool > onDone=null)
 Downloads the objects in Amazon S3 that have a key that starts with the value specified by the S3Directory property of the passed in TransferUtilityDownloadDirectoryRequest object. More...
 
void AbortMultipartUploads (string bucketName, DateTime initiatedDate, Action< bool > onDone=null)
 Aborts the multipart uploads that were initiated before the specified date. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Implements the Dispose pattern for the AmazonWebServiceClient More...
 

Properties

IAmazonS3 S3Client [get]
 Gets the Amazon S3 client used for making calls into Amazon S3. More...
 

Detailed Description

Provides a high level utility for managing transfers to and from Amazon S3.

TransferUtility provides a simple API for uploading content to and downloading content from Amazon S3. It makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance, and reliability.

When uploading large files by specifying file paths instead of a stream, TransferUtility uses multiple threads to upload multiple parts of a single upload at once. When dealing with large content sizes and high bandwidth, this can increase throughput significantly.

Transfers are stored in memory. If the application is restarted, previous transfers are no longer accessible. In this situation, if necessary, you should clean up any multipart uploads that are incomplete.

Constructor & Destructor Documentation

Amazon.S3.Transfer.TransferUtility.TransferUtility ( )

Constructs a new TransferUtility class.

If a Timeout needs to be specified, use the constructor which takes an Amazon.S3.AmazonS3Client as a paramater. Use an instance of Amazon.S3.AmazonS3Client constructed with an Amazon.S3.AmazonS3Config object with the Timeout specified.

Amazon.S3.Transfer.TransferUtility.TransferUtility ( RegionEndpoint  region)

Constructs a new TransferUtility class.

Parameters
regionThe region to configure the transfer utility for.

If a Timeout needs to be specified, use the constructor which takes an Amazon.S3.AmazonS3Client as a paramater. Use an instance of Amazon.S3.AmazonS3Client constructed with an Amazon.S3.AmazonS3Config object with the Timeout specified.

Amazon.S3.Transfer.TransferUtility.TransferUtility ( string  awsAccessKeyId,
string  awsSecretAccessKey 
)

Constructs a new TransferUtility class.

Parameters
awsAccessKeyIdThe AWS Access Key ID.
awsSecretAccessKeyThe AWS Secret Access Key.

If a Timeout needs to be specified, use the constructor which takes an Amazon.S3.AmazonS3Client as a paramater. Use an instance of Amazon.S3.AmazonS3Client constructed with an Amazon.S3.AmazonS3Config object with the Timeout specified.

Amazon.S3.Transfer.TransferUtility.TransferUtility ( string  awsAccessKeyId,
string  awsSecretAccessKey,
RegionEndpoint  region 
)

Constructs a new TransferUtility class.

Parameters
awsAccessKeyIdThe AWS Access Key ID.
awsSecretAccessKeyThe AWS Secret Access Key.
regionThe region to configure the transfer utility for.

If a Timeout needs to be specified, use the constructor which takes an Amazon.S3.AmazonS3Client as a paramater. Use an instance of Amazon.S3.AmazonS3Client constructed with an Amazon.S3.AmazonS3Config object with the Timeout specified.

Amazon.S3.Transfer.TransferUtility.TransferUtility ( string  awsAccessKeyId,
string  awsSecretAccessKey,
TransferUtilityConfig  config 
)

Constructs a new instance of the TransferUtility class.

Parameters
awsAccessKeyIdThe AWS Access Key ID.
awsSecretAccessKeyThe AWS Secret Access Key.
configSpecifies advanced settings.

If a Timeout needs to be specified, use the constructor which takes an Amazon.S3.AmazonS3Client as a paramater. Use an instance of Amazon.S3.AmazonS3Client constructed with an Amazon.S3.AmazonS3Config object with the Timeout specified.

Amazon.S3.Transfer.TransferUtility.TransferUtility ( string  awsAccessKeyId,
string  awsSecretAccessKey,
RegionEndpoint  region,
TransferUtilityConfig  config 
)

Constructs a new instance of the TransferUtility class.

Parameters
awsAccessKeyIdThe AWS Access Key ID.
awsSecretAccessKeyThe AWS Secret Access Key.
regionThe region to configure the transfer utility for.
configSpecifies advanced settings.

If a Timeout needs to be specified, use the constructor which takes an Amazon.S3.AmazonS3Client as a paramater. Use an instance of Amazon.S3.AmazonS3Client constructed with an Amazon.S3.AmazonS3Config object with the Timeout specified.

Amazon.S3.Transfer.TransferUtility.TransferUtility ( IAmazonS3  s3Client)

Constructs a new instance of the TransferUtility class.

Parameters
s3ClientThe Amazon S3 client.

If a Timeout needs to be specified, use the constructor which takes an Amazon.S3.AmazonS3Client as a paramater. Use an instance of Amazon.S3.AmazonS3Client constructed with an Amazon.S3.AmazonS3Config object with the Timeout specified.

Amazon.S3.Transfer.TransferUtility.TransferUtility ( IAmazonS3  s3Client,
TransferUtilityConfig  config 
)

Initializes a new instance of the TransferUtility class.

Parameters
s3ClientThe Amazon S3 client.
configSpecifies advanced configuration settings for TransferUtility.

If a Timeout needs to be specified, use the constructor which takes an Amazon.S3.AmazonS3Client as a paramater. Use an instance of Amazon.S3.AmazonS3Client constructed with an Amazon.S3.AmazonS3Config object with the Timeout specified.

Member Function Documentation

void Amazon.S3.Transfer.TransferUtility.AbortMultipartUploads ( string  bucketName,
DateTime  initiatedDate,
Action< bool >  onDone = null 
)

Aborts the multipart uploads that were initiated before the specified date.

Parameters
bucketNameThe name of the bucket containing multipart uploads.
initiatedDateThe date before which the multipart uploads were initiated.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
virtual void Amazon.S3.Transfer.TransferUtility.Dispose ( bool  disposing)
protectedvirtual

Implements the Dispose pattern for the AmazonWebServiceClient

Parameters
disposingWhether this object is being disposed via a call to Dispose or garbage collected.
void Amazon.S3.Transfer.TransferUtility.Dispose ( )

Disposes of all managed and unmanaged resources.

void Amazon.S3.Transfer.TransferUtility.Download ( string  filePath,
string  bucketName,
string  key,
Action< bool >  onDone = null 
)

Downloads the content from Amazon S3 and writes it to the specified file. The object key is derived from the file name.

Parameters
filePathThe file path where the content from Amazon S3 will be written to.
bucketNameThe name of the bucket containing the Amazon S3 object to download.
keyThe key under which the Amazon S3 object is stored.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
void Amazon.S3.Transfer.TransferUtility.Download ( TransferUtilityDownloadRequest  request,
Action< bool >  onDone = null 
)

Downloads the content from Amazon S3 and writes it to the specified file. If the key is not specified in the request parameter, the file name will used as the key name.

Parameters
requestContains all the parameters required to download an Amazon S3 object.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
void Amazon.S3.Transfer.TransferUtility.DownloadDirectory ( string  bucketName,
string  s3Directory,
string  localDirectory,
Action< bool >  onDone = null 
)

Downloads the objects in Amazon S3 that have a key that starts with the value specified by s3Directory.

Parameters
bucketNameThe name of the bucket containing the Amazon S3 objects to download.
s3DirectoryThe directory in Amazon S3 to download.
localDirectoryThe local directory to download the objects to.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
void Amazon.S3.Transfer.TransferUtility.DownloadDirectory ( TransferUtilityDownloadDirectoryRequest  request,
Action< bool >  onDone = null 
)

Downloads the objects in Amazon S3 that have a key that starts with the value specified by the S3Directory property of the passed in TransferUtilityDownloadDirectoryRequest object.

Parameters
requestContains all the parameters required to download objects from Amazon S3 into a local directory.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
Stream Amazon.S3.Transfer.TransferUtility.OpenStream ( string  bucketName,
string  key,
Action< bool >  onDone = null 
)

Returns a stream from which the caller can read the content from the specified Amazon S3 bucket and key. The caller of this method is responsible for closing the stream.

Parameters
bucketNameThe name of the bucket.
keyThe object key.
Returns
A stream of the contents from the specified Amazon S3 and key.
Parameters
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
Stream Amazon.S3.Transfer.TransferUtility.OpenStream ( TransferUtilityOpenStreamRequest  request,
Action< bool >  onDone = null 
)

Returns a stream to read the contents from Amazon S3 as specified by the TransferUtilityOpenStreamRequest. The caller of this method is responsible for closing the stream.

Parameters
requestContains all the parameters required to open a stream to an S3 object.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
Returns
A stream of the contents from Amazon S3.
void Amazon.S3.Transfer.TransferUtility.Upload ( string  filePath,
string  bucketName,
Action< bool >  onDone = null 
)

Uploads the specified file. The object key is derived from the file's name. Multiple threads are used to read the file and perform multiple uploads in parallel. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.

If you are uploading large files, TransferUtility will use multipart upload to fulfill the request. If a multipart upload is interrupted, TransferUtility will attempt to abort the multipart upload. Under certain circumstances (network outage, power failure, etc.), TransferUtility will not be able to abort the multipart upload. In this case, in order to stop getting charged for the storage of uploaded parts, you should manually invoke TransferUtility.AbortMultipartUploads() to abort the incomplete multipart uploads.

Parameters
filePathThe file path of the file to upload.
bucketNameThe target Amazon S3 bucket, that is, the name of the bucket to upload the file to.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
void Amazon.S3.Transfer.TransferUtility.Upload ( string  filePath,
string  bucketName,
string  key,
Action< bool >  onDone = null 
)

Uploads the specified file. Multiple threads are used to read the file and perform multiple uploads in parallel. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.

If you are uploading large files, TransferUtility will use multipart upload to fulfill the request. If a multipart upload is interrupted, TransferUtility will attempt to abort the multipart upload. Under certain circumstances (network outage, power failure, etc.), TransferUtility will not be able to abort the multipart upload. In this case, in order to stop getting charged for the storage of uploaded parts, you should manually invoke TransferUtility.AbortMultipartUploads() to abort the incomplete multipart uploads.

Parameters
filePathThe file path of the file to upload.
bucketNameThe target Amazon S3 bucket, that is, the name of the bucket to upload the file to.
keyThe key under which the Amazon S3 object is stored.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
void Amazon.S3.Transfer.TransferUtility.Upload ( Stream  stream,
string  bucketName,
string  key,
Action< bool >  onDone = null 
)

Uploads the contents of the specified stream. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.

If you are uploading large files, TransferUtility will use multipart upload to fulfill the request. If a multipart upload is interrupted, TransferUtility will attempt to abort the multipart upload. Under certain circumstances (network outage, power failure, etc.), TransferUtility will not be able to abort the multipart upload. In this case, in order to stop getting charged for the storage of uploaded parts, you should manually invoke TransferUtility.AbortMultipartUploads() to abort the incomplete multipart uploads.

Parameters
streamThe stream to read to obtain the content to upload.
bucketNameThe target Amazon S3 bucket, that is, the name of the bucket to upload the stream to.
keyThe key under which the Amazon S3 object is stored.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
void Amazon.S3.Transfer.TransferUtility.Upload ( TransferUtilityUploadRequest  request,
Action< bool >  onDone = null 
)

Uploads the file or stream specified by the request. To track the progress of the upload, add an event listener to the request's UploadProgressEvent. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.

If you are uploading large files, TransferUtility will use multipart upload to fulfill the request. If a multipart upload is interrupted, TransferUtility will attempt to abort the multipart upload. Under certain circumstances (network outage, power failure, etc.), TransferUtility will not be able to abort the multipart upload. In this case, in order to stop getting charged for the storage of uploaded parts, you should manually invoke TransferUtility.AbortMultipartUploads() to abort the incomplete multipart uploads.

Parameters
requestContains all the parameters required to upload to Amazon S3.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
void Amazon.S3.Transfer.TransferUtility.UploadDirectory ( string  directory,
string  bucketName,
Action< bool >  onDone = null 
)

Uploads files from a specified directory. The object key is derived from the file names inside the directory. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.

If you are uploading large files, TransferUtility will use multipart upload to fulfill the request. If a multipart upload is interrupted, TransferUtility will attempt to abort the multipart upload. Under certain circumstances (network outage, power failure, etc.), TransferUtility will not be able to abort the multipart upload. In this case, in order to stop getting charged for the storage of uploaded parts, you should manually invoke TransferUtility.AbortMultipartUploads() to abort the incomplete multipart uploads.

Parameters
directoryThe source directory, that is, the directory containing the files to upload.
bucketNameThe target Amazon S3 bucket, that is, the name of the bucket to upload the files to.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
void Amazon.S3.Transfer.TransferUtility.UploadDirectory ( string  directory,
string  bucketName,
string  searchPattern,
SearchOption  searchOption,
Action< bool >  onDone = null 
)

Uploads files from a specified directory. The object key is derived from the file names inside the directory. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.

If you are uploading large files, TransferUtility will use multipart upload to fulfill the request. If a multipart upload is interrupted, TransferUtility will attempt to abort the multipart upload. Under certain circumstances (network outage, power failure, etc.), TransferUtility will not be able to abort the multipart upload. In this case, in order to stop getting charged for the storage of uploaded parts, you should manually invoke TransferUtility.AbortMultipartUploads() to abort the incomplete multipart uploads.

Parameters
directoryThe source directory, that is, the directory containing the files to upload.
bucketNameThe target Amazon S3 bucket, that is, the name of the bucket to upload the files to.
searchPatternA pattern used to identify the files from the source directory to upload.
searchOptionA search option that specifies whether to recursively search for files to upload in subdirectories.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.
void Amazon.S3.Transfer.TransferUtility.UploadDirectory ( TransferUtilityUploadDirectoryRequest  request,
Action< bool >  onDone = null 
)

Uploads files from a specified directory. The object key is derived from the file names inside the directory. For large uploads, the file will be divided and uploaded in parts using Amazon S3's multipart API. The parts will be reassembled as one object in Amazon S3.

If you are uploading large files, TransferUtility will use multipart upload to fulfill the request. If a multipart upload is interrupted, TransferUtility will attempt to abort the multipart upload. Under certain circumstances (network outage, power failure, etc.), TransferUtility will not be able to abort the multipart upload. In this case, in order to stop getting charged for the storage of uploaded parts, you should manually invoke TransferUtility.AbortMultipartUploads() to abort the incomplete multipart uploads.

Parameters
requestThe request that contains all the parameters required to upload a directory.
onDoneCallback for when the operation is complete. Sends a bool that indicates success/failure.

Property Documentation

IAmazonS3 Amazon.S3.Transfer.TransferUtility.S3Client
get

Gets the Amazon S3 client used for making calls into Amazon S3.

The Amazon S3 client used for making calls into Amazon S3.


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