AWS SDK Version 3 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.

This class defines utilities and constants that can be used by all the client libraries of the SDK.

Inheritance Hierarchy

System.Object
  Amazon.Util.AWSSDKUtils

Namespace: Amazon.Util
Assembly: AWSSDK.Core.dll
Version: 3.x.y.z

Syntax

C#
public static class AWSSDKUtils

The AWSSDKUtils type exposes the following members

Properties

NameTypeDescription
Public Property Static Property CorrectedUtcNow System.DateTime

Returns DateTime.UtcNow + ManualClockCorrection when Amazon.AWSConfigs.ManualClockCorrection is set. Otherwise returns DateTime.UtcNow + ClockOffset when Amazon.AWSConfigs.CorrectForClockSkew is true. This value should be used when constructing requests, as it will represent accurate time w.r.t. AWS servers.

Public Property Static Property FormattedCurrentTimestampGMT System.String

Formats the current date as a GMT timestamp

Public Property Static Property FormattedCurrentTimestampISO8601 System.String

Formats the current date as ISO 8601 timestamp

Public Property Static Property FormattedCurrentTimestampRFC822 System.String

Formats the current date as ISO 8601 timestamp

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method Static Method BytesToHexString(Byte[])

Convert bytes to a hex string

Public Method Static Method CanonicalizeResourcePath(Uri, string)

Returns the canonicalized resource path for the service endpoint

Public Method Static Method ConvertFromUnixEpochSeconds(int)

Utility method for converting Unix epoch seconds to DateTime structure.

Public Method Static Method ConvertToUnixEpochMilliSeconds(DateTime)
Public Method Static Method ConvertToUnixEpochSeconds(DateTime)
Public Method Static Method ConvertToUnixEpochSecondsString(DateTime)
Public Method Static Method CopyStream(Stream, Stream)

Utility method for copy the contents of the source stream to the destination stream.

Public Method Static Method CopyStream(Stream, Stream, int)

Utility method for copy the contents of the source stream to the destination stream.

Public Method Static Method DetermineRegion(string)

Attempt to infer the region for a service request based on the endpoint

Public Method Static Method DetermineService(string)

Attempt to infer the service name for a request (in short form, eg 'iam') from the service endpoint.

Public Method Static Method DownloadStringContent(Uri)
Public Method Static Method DownloadStringContent(Uri, TimeSpan)
Public Method Static Method ForceCanonicalPathAndQuery(Uri)
Public Method Static Method GenerateMemoryStreamFromString(string)

Utility method for converting a string to a MemoryStream.

Public Method Static Method GetExtension(string)

Returns an extension of a path. This has the same behavior as System.IO.Path.GetExtension, but does not check the path for invalid characters.

Public Method Static Method GetFormattedTimestampISO8601(int)

Gets the ISO8601 formatted timestamp that is minutesFromNow in the future.

Public Method Static Method GetFormattedTimestampRFC822(int)

Gets the RFC822 formatted timestamp that is minutesFromNow in the future.

Public Method Static Method HasBidiControlCharacters(string)

Returns true if the string has any bidirectional control characters.

Public Method Static Method HexStringToBytes(string)

Convert a hex string to bytes

Public Method Static Method InvokeInBackground(EventHandler<T>, T, object)

Calls a specific EventHandler in a background thread

Public Method Static Method Join(List<String>)

Returns a new string created by joining each of the strings in the specified list together, with a comma between them.

Public Method Static Method OpenStream(Uri)
Public Method Static Method ParseQueryParameters(string)

Parses a query string of a URL and returns the parameters as a string-to-string dictionary.

Public Method Static Method PreserveStackTrace(Exception)

This method is used preserve the stacktrace used from clients that support async calls. This make sure that exceptions thrown during EndXXX methods has the orignal stacktrace that happen in the background thread.

Public Method Static Method Sleep(TimeSpan)
Public Method Static Method Sleep(int)
Public Method Static Method ToHex(Byte[], bool)

Helper function to format a byte array into string

Public Method Static Method UrlEncode(string, bool)

URL encodes a string per RFC3986. If the path property is specified, the accepted path characters {/+:} are not encoded.

Public Method Static Method UrlEncode(int, string, bool)

URL encodes a string per the specified RFC. If the path property is specified, the accepted path characters {/+:} are not encoded.

Fields

NameTypeDescription
Field Static Field DefaultBufferSize System.Int32
Field Static Field DefaultProgressUpdateInterval System.Int64
Field Static Field EPOCH_START System.DateTime
Field Static Field GMTDateFormat System.String

The GMT Date Format string. Used when parsing date objects

Field Static Field ISO8601BasicDateFormat System.String

The ISO8601 basic date format. Used during AWS4 signature computation.

Field Static Field ISO8601BasicDateTimeFormat System.String

The ISO8601 Basic date/time format string. Used when parsing date objects

Field Static Field ISO8601DateFormat System.String

The ISO8601Date Format string. Used when parsing date objects

Field Static Field ISO8601DateFormatNoMS System.String

The ISO8601Date Format string. Used when parsing date objects

Field Static Field RFC822DateFormat System.String

The RFC822Date Format string. Used when parsing date objects

Field Static Field UrlEncodedContent System.String

The string representing Url Encoded Content in HTTP requests

Field Static Field UserAgentHeader System.String

The user agent string header

Field Static Field ValidUrlCharacters System.String

The Set of accepted and valid Url characters per RFC3986. Characters outside of this set will be encoded.

Field Static Field ValidUrlCharactersRFC1738 System.String

The Set of accepted and valid Url characters per RFC1738. Characters outside of this set will be encoded.

Version Information

.NET Standard:
Supported in: 1.3

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

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

Unity:
Supported Versions: 4.6 and above
Supported Platforms: Android, iOS, Standalone