AWS SDK Version 2 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

.NET Framework 3.5
 
Provides utilities used by the Amazon S3 client implementation. These utilities might be useful to consumers of the Amazon S3 library.

Inheritance Hierarchy

System.Object
  Amazon.S3.Util.AmazonS3Util

Namespace: Amazon.S3.Util
Assembly: AWSSDK.dll
Version: (assembly version)

Syntax

C#
public static class AmazonS3Util : Object

The AmazonS3Util type exposes the following members

Properties

NameTypeDescription
Public Property Static Property FormattedCurrentTimestamp System.String Formats the current date as a GMT timestamp

Methods

NameDescription
Public Method Static Method BeginDeleteS3BucketWithObjects(IAmazonS3, string, AsyncCallback, object) Initiates the asynchronous execution of the DeleteS3BucketWithObjects operation. DeleteS3BucketWithObjects deletes an S3 bucket which contains objects. An S3 bucket which contains objects cannot be deleted until all the objects in it are deleted. This method deletes all the objects in the specified bucket and then deletes the bucket itself.
Public Method Static Method BeginDeleteS3BucketWithObjects(IAmazonS3, string, S3DeleteBucketWithObjectsOptions, AsyncCallback, object) Initiates the asynchronous execution of the DeleteS3BucketWithObjects operation. DeleteS3BucketWithObjects deletes an S3 bucket which contains objects. An S3 bucket which contains objects cannot be deleted until all the objects in it are deleted. This method deletes all the objects in the specified bucket and then deletes the bucket itself.
Public Method Static Method BeginDeleteS3BucketWithObjects(IAmazonS3, string, S3DeleteBucketWithObjectsOptions, Action<S3DeleteBucketWithObjectsUpdate>, AsyncCallback, object) Initiates the asynchronous execution of the DeleteS3BucketWithObjects operation. DeleteS3BucketWithObjects deletes an S3 bucket which contains objects. An S3 bucket which contains objects cannot be deleted until all the objects in it are deleted. This method deletes all the objects in the specified bucket and then deletes the bucket itself.
Public Method Static Method ConvertToS3StorageClass(string) Converts the string representing a storage class that would come back from a ListObjects request to the S3StorageClass enumeration.
Public Method Static Method DeleteS3BucketWithObjects(IAmazonS3, string) Deletes an S3 bucket which contains objects. An S3 bucket which contains objects cannot be deleted until all the objects in it are deleted. This method deletes all the objects in the specified bucket and then deletes the bucket itself.
Public Method Static Method DeleteS3BucketWithObjects(IAmazonS3, string, S3DeleteBucketWithObjectsOptions) Deletes an S3 bucket which contains objects. An S3 bucket which contains objects cannot be deleted until all the objects in it are deleted. This method deletes all the objects in the specified bucket and then deletes the bucket itself.
Public Method Static Method DoesS3BucketExist(IAmazonS3, string) Determines whether an S3 bucket exists or not. This is done by: 1. Creating a PreSigned Url for the bucket. To work with Signature V4 only regions, as well as Signature V4-optional regions, we keep the expiry to within the maximum for V4 (which is one week). 2. Making a HEAD request to the Url
Public Method Static Method EndDeleteS3BucketWithObjects(IAsyncCancelableResult) Finishes the asynchronous execution of the DeleteS3BucketWithObjects operation.
Public Method Static Method GenerateChecksumForContent(string, bool) Generates an MD5 Digest for the string-based content
Public Method Static Method MakeStreamSeekable(Stream) Converts a non-seekable stream into a System.IO.MemoryStream. A MemoryStream's position can be moved arbitrarily
Public Method Static Method MimeTypeFromExtension(string) Determines MIME type from a file extension
Public Method Static Method PostUpload(S3PostUploadRequest) Upload data to Amazon S3 using HTTP POST.
Public Method Static Method SetObjectStorageClass(IAmazonS3, string, string, S3StorageClass) Sets the storage class for the S3 Object to the value specified.
Public Method Static Method SetObjectStorageClass(IAmazonS3, string, string, string, S3StorageClass) Sets the storage class for the S3 Object's Version to the value specified.
Public Method Static Method SetServerSideEncryption(IAmazonS3, string, string, ServerSideEncryptionMethod) Sets the server side encryption method for the S3 Object to the value specified.
Public Method Static Method SetServerSideEncryption(IAmazonS3, string, string, string, ServerSideEncryptionMethod) Sets the server side encryption method for the S3 Object's Version to the value specified.
Public Method Static Method SetWebsiteRedirectLocation(IAmazonS3, string, string, string) Sets the redirect location for the S3 Object's when being accessed through the S3 website endpoint.
Public Method Static Method UrlEncode(string, bool) URL encodes a string. If the path property is specified, the accepted path characters {/+:} are not encoded.
Public Method Static Method ValidateV2Bucket(string) Version2 S3 buckets adhere to RFC 1035: Less than 255 characters, with each label less than 63 characters.Label must start with a letterLabel must end with a letter or digitLabel can have a string of letter, digits and hyphens in the middle.Although names can be case-sensitive, no significance is attached to the case.RFC 1123: Allow label to start with letter or digit (e.g. 3ware.com works)RFC 2181: No restrictions apart from the length restrictions. S3 V2 will start with RFCs 1035 and 1123 and impose the following additional restrictions: Length between 3 and 63 characters (to allow headroom for upper-level domains, as well as to avoid separate length restrictions for bucket-name and its labelsOnly lower-case to avoid user confusion.No dotted-decimal IPv4-like strings

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8

.NET for Windows Phone:
Supported in: Windows Phone 8.1, Windows Phone 8