Table of Contents

Class ShareHttpWebRequestFactory

Namespace
Microsoft.WindowsAzure.Storage.File.Protocol
Assembly
Microsoft.WindowsAzure.Storage.dll

A factory class for constructing web requests for operations on shares in the File service.

public static class ShareHttpWebRequestFactory
Inheritance
ShareHttpWebRequestFactory
Inherited Members

Methods

AddMetadata(HttpWebRequest, IDictionary<string, string>)

Adds user-defined metadata to the request as one or more name-value pairs.

public static void AddMetadata(HttpWebRequest request, IDictionary<string, string> metadata)

Parameters

request HttpWebRequest

The web request.

metadata IDictionary<string, string>

The user-defined metadata.

AddMetadata(HttpWebRequest, string, string)

Adds user-defined metadata to the request as a single name-value pair.

public static void AddMetadata(HttpWebRequest request, string name, string value)

Parameters

request HttpWebRequest

The web request.

name string

The metadata name.

value string

The metadata value.

Create(Uri, FileShareProperties, int?, bool, OperationContext)

Constructs a web request to create a new share.

public static HttpWebRequest Create(Uri uri, FileShareProperties properties, int? timeout, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

The absolute URI to the share.

properties FileShareProperties

Properties to set on the share.

timeout int?

The server timeout interval.

useVersionHeader bool

A boolean value indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object for tracking the current operation.

Returns

HttpWebRequest

A web request to use to perform the operation.

Create(Uri, int?, bool, OperationContext)

Constructs a web request to create a new share.

public static HttpWebRequest Create(Uri uri, int? timeout, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

The absolute URI to the share.

timeout int?

The server timeout interval.

useVersionHeader bool

A boolean value indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object for tracking the current operation.

Returns

HttpWebRequest

A web request to use to perform the operation.

Delete(Uri, int?, AccessCondition, bool, OperationContext)

Constructs a web request to delete the share and all of the files within it.

public static HttpWebRequest Delete(Uri uri, int? timeout, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

The absolute URI to the share.

timeout int?

The server timeout interval.

accessCondition AccessCondition

The access condition to apply to the request.

useVersionHeader bool

A boolean value indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object for tracking the current operation.

Returns

HttpWebRequest

A web request to use to perform the operation.

Delete(Uri, int?, DateTimeOffset?, DeleteShareSnapshotsOption, AccessCondition, bool, OperationContext)

Constructs a web request to delete the share and all of the files within it.

public static HttpWebRequest Delete(Uri uri, int? timeout, DateTimeOffset? snapshot, DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

The absolute URI to the share.

timeout int?

The server timeout interval.

snapshot DateTimeOffset?

A DateTimeOffset specifying the snapshot timestamp, if the share is a snapshot.

deleteSnapshotsOption DeleteShareSnapshotsOption

A DeleteShareSnapshotsOption object indicating whether to only delete the share or delete the share and all snapshots.

accessCondition AccessCondition

The access condition to apply to the request.

useVersionHeader bool

A flag indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object for tracking the current operation.

Returns

HttpWebRequest

A web request to use to perform the operation.

GetAcl(Uri, int?, AccessCondition, bool, OperationContext)

Constructs a web request to return the ACL for a share.

public static HttpWebRequest GetAcl(Uri uri, int? timeout, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

A System.Uri specifying the absolute URI to the share.

timeout int?

An integer specifying the server timeout interval.

accessCondition AccessCondition

An AccessCondition object that represents the condition that must be met in order for the request to proceed.

useVersionHeader bool

A boolean value indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object that represents the context for the current operation.

Returns

HttpWebRequest

A HttpWebRequest object.

GetMetadata(Uri, int?, AccessCondition, bool, OperationContext)

Generates a web request to return the user-defined metadata for this share.

public static HttpWebRequest GetMetadata(Uri uri, int? timeout, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

The absolute URI to the share.

timeout int?

The server timeout interval.

accessCondition AccessCondition

The access condition to apply to the request.

useVersionHeader bool

A boolean value indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object for tracking the current operation.

Returns

HttpWebRequest

A web request to use to perform the operation.

GetMetadata(Uri, int?, DateTimeOffset?, AccessCondition, bool, OperationContext)

Generates a web request to return the user-defined metadata for this share.

public static HttpWebRequest GetMetadata(Uri uri, int? timeout, DateTimeOffset? snapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

The absolute URI to the share.

timeout int?

The server timeout interval.

snapshot DateTimeOffset?

A DateTimeOffset specifying the snapshot timestamp, if the share is a snapshot.

accessCondition AccessCondition

The access condition to apply to the request.

useVersionHeader bool

A flag indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object for tracking the current operation.

Returns

HttpWebRequest

A web request to use to perform the operation.

GetProperties(Uri, int?, AccessCondition, bool, OperationContext)

Generates a web request to return the properties and user-defined metadata for this share.

public static HttpWebRequest GetProperties(Uri uri, int? timeout, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

The absolute URI to the share.

timeout int?

The server timeout interval.

accessCondition AccessCondition

The access condition to apply to the request.

useVersionHeader bool

A boolean value indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object for tracking the current operation.

Returns

HttpWebRequest

A web request to use to perform the operation.

GetProperties(Uri, int?, DateTimeOffset?, AccessCondition, bool, OperationContext)

Generates a web request to return the properties and user-defined metadata for this share.

public static HttpWebRequest GetProperties(Uri uri, int? timeout, DateTimeOffset? snapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

The absolute URI to the share.

timeout int?

The server timeout interval.

snapshot DateTimeOffset?

A DateTimeOffset specifying the snapshot timestamp, if the share is a snapshot.

accessCondition AccessCondition

The access condition to apply to the request.

useVersionHeader bool

A flag indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object for tracking the current operation.

Returns

HttpWebRequest

A web request to use to perform the operation.

GetStats(Uri, int?, bool, OperationContext)

Creates a web request to get the stats of the share.

public static HttpWebRequest GetStats(Uri uri, int? timeout, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

A System.Uri specifying the share.

timeout int?

The server timeout interval, in seconds.

useVersionHeader bool

A boolean value indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object that represents the context for the current operation.

Returns

HttpWebRequest

A HttpWebRequest object.

List(Uri, int?, ListingContext, ShareListingDetails, bool, OperationContext)

Constructs a web request to return a listing of all shares in this storage account.

public static HttpWebRequest List(Uri uri, int? timeout, ListingContext listingContext, ShareListingDetails detailsIncluded, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

The absolute URI for the account.

timeout int?

The server timeout interval.

listingContext ListingContext

A set of parameters for the listing operation.

detailsIncluded ShareListingDetails

Additional details to return with the listing.

useVersionHeader bool

A boolean value indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object for tracking the current operation.

Returns

HttpWebRequest

A web request for the specified operation.

SetAcl(Uri, int?, FileSharePublicAccessType, AccessCondition, bool, OperationContext)

Constructs a web request to set the ACL for a share.

public static HttpWebRequest SetAcl(Uri uri, int? timeout, FileSharePublicAccessType publicAccess, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

A System.Uri specifying the absolute URI to the share.

timeout int?

An integer specifying the server timeout interval.

publicAccess FileSharePublicAccessType

The type of public access to allow for the share.

accessCondition AccessCondition

An AccessCondition object that represents the condition that must be met in order for the request to proceed.

useVersionHeader bool

A boolean value indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object that represents the context for the current operation.

Returns

HttpWebRequest

A HttpWebRequest object.

SetMetadata(Uri, int?, AccessCondition, bool, OperationContext)

Generates a web request to set user-defined metadata for the share.

public static HttpWebRequest SetMetadata(Uri uri, int? timeout, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

The absolute URI to the share.

timeout int?

The server timeout interval.

accessCondition AccessCondition

The access condition to apply to the request.

useVersionHeader bool

A boolean value indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object for tracking the current operation.

Returns

HttpWebRequest

A web request to use to perform the operation.

SetProperties(Uri, int?, FileShareProperties, AccessCondition, bool, OperationContext)

Constructs a web request to set system properties for a share.

public static HttpWebRequest SetProperties(Uri uri, int? timeout, FileShareProperties properties, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

A System.Uri specifying the absolute URI to the share.

timeout int?

An integer specifying the server timeout interval.

properties FileShareProperties

The share's properties.

accessCondition AccessCondition

An AccessCondition object that represents the condition that must be met in order for the request to proceed.

useVersionHeader bool

A boolean value indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object that represents the context for the current operation.

Returns

HttpWebRequest

A HttpWebRequest object.

Snapshot(Uri, int?, AccessCondition, bool, OperationContext)

Constructs a web request to create a snapshot of a share.

public static HttpWebRequest Snapshot(Uri uri, int? timeout, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext)

Parameters

uri Uri

A System.Uri specifying the absolute URI to the share.

timeout int?

An integer specifying the server timeout interval.

accessCondition AccessCondition

An AccessCondition object that represents the condition that must be met in order for the request to proceed.

useVersionHeader bool

A flag indicating whether to set the x-ms-version HTTP header.

operationContext OperationContext

An OperationContext object that represents the context for the current operation.

Returns

HttpWebRequest

A HttpWebRequest object.