/// <summary> /// Constructs a web request to write or clear a range of pages in a page blob. /// </summary> /// <param name="uri">The absolute URI to the blob.</param> /// <param name="timeout">The server timeout interval.</param> /// <param name="properties">The blob's properties.</param> /// <param name="accessCondition">The access condition to apply to the request.</param> /// <returns>A web request to use to perform the operation.</returns> public static HttpRequestMessage PutPage(Uri uri, int?timeout, PageRange pageRange, PageWrite pageWrite, AccessCondition accessCondition, HttpContent content, OperationContext operationContext) { UriQueryBuilder builder = new UriQueryBuilder(); builder.Add(Constants.QueryConstants.Component, "page"); HttpRequestMessage request = HttpRequestMessageFactory.CreateRequestMessage(HttpMethod.Put, uri, timeout, builder, content, operationContext); request.AddOptionalHeader(Constants.HeaderConstants.RangeHeader, pageRange.ToString()); request.Headers.Add(Constants.HeaderConstants.PageWrite, pageWrite.ToString()); request.ApplyAccessCondition(accessCondition); return(request); }
/// <summary> /// Constructs a web request to write or clear a range of pages in a page blob. /// </summary> /// <param name="uri">The absolute URI to the blob.</param> /// <param name="timeout">The server timeout interval.</param> /// <param name="properties">The blob's properties.</param> /// <param name="accessCondition">The access condition to apply to the request.</param> /// <returns>A web request to use to perform the operation.</returns> public static StorageRequestMessage PutPage(Uri uri, int?timeout, PageRange pageRange, PageWrite pageWrite, AccessCondition accessCondition, HttpContent content, OperationContext operationContext, ICanonicalizer canonicalizer, StorageCredentials credentials) { UriQueryBuilder builder = new UriQueryBuilder(); builder.Add(Constants.QueryConstants.Component, "page"); StorageRequestMessage request = HttpRequestMessageFactory.CreateRequestMessage(HttpMethod.Put, uri, timeout, builder, content, operationContext, canonicalizer, credentials); request.Headers.Add(Constants.HeaderConstants.RangeHeader, pageRange.ToString()); request.Headers.Add(Constants.HeaderConstants.PageWrite, pageWrite.ToString()); request.ApplyAccessCondition(accessCondition); request.ApplySequenceNumberCondition(accessCondition); return(request); }
/// <summary> /// Constructs a web request to write or clear a range of pages in a page blob. /// </summary> /// <param name="uri">The absolute URI to the blob.</param> /// <param name="timeout">The server timeout interval.</param> /// <param name="pageRange">The page range, defined by an object of type <see cref="PageRange"/>.</param> /// <param name="pageWrite">A value of type <see cref="PageWrite"/>, indicating the operation to perform on the page blob.</param> /// <param name="accessCondition">The <see cref="AccessCondition"/> to apply to the request.</param> /// <param name="operationContext">An <see cref="OperationContext" /> object for tracking the current operation.</param> /// <returns> /// A web request to use to perform the operation. /// </returns> public static HttpWebRequest PutPage(Uri uri, int?timeout, PageRange pageRange, PageWrite pageWrite, AccessCondition accessCondition, OperationContext operationContext) { CommonUtility.AssertNotNull("pageRange", pageRange); UriQueryBuilder builder = new UriQueryBuilder(); builder.Add(Constants.QueryConstants.Component, "page"); HttpWebRequest request = HttpWebRequestFactory.CreateWebRequest(WebRequestMethods.Http.Put, uri, timeout, builder, operationContext); request.Headers.Add(Constants.HeaderConstants.RangeHeader, pageRange.ToString()); request.Headers.Add(Constants.HeaderConstants.PageWrite, pageWrite.ToString()); request.ApplyAccessCondition(accessCondition); request.ApplySequenceNumberCondition(accessCondition); return(request); }
/// <summary> /// Constructs a web request to write or clear a range of pages in a page blob. /// </summary> /// <param name="uri">A <see cref="System.Uri"/> specifying the absolute URI to the blob.</param> /// <param name="timeout">An integer specifying the server timeout interval.</param> /// <param name="pageRange">A <see cref="PageRange"/> object.</param> /// <param name="pageWrite">A <see cref="PageWrite"/> enumeration value indicating the operation to perform on the page blob.</param> /// <param name="accessCondition">An <see cref="AccessCondition"/> object that represents the condition that must be met in order for the request to proceed.</param> /// <param name="useVersionHeader">A boolean value indicating whether to set the <i>x-ms-version</i> HTTP header.</param> /// <param name="operationContext">An <see cref="OperationContext"/> object that represents the context for the current operation.</param> /// <returns> /// A web request to use to perform the operation. /// </returns> public static HttpWebRequest PutPage(Uri uri, int? timeout, PageRange pageRange, PageWrite pageWrite, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { CommonUtility.AssertNotNull("pageRange", pageRange); UriQueryBuilder builder = new UriQueryBuilder(); builder.Add(Constants.QueryConstants.Component, "page"); HttpWebRequest request = HttpWebRequestFactory.CreateWebRequest(WebRequestMethods.Http.Put, uri, timeout, builder, useVersionHeader, operationContext); request.Headers.Add(Constants.HeaderConstants.RangeHeader, pageRange.ToString()); request.Headers.Add(Constants.HeaderConstants.PageWrite, pageWrite.ToString()); request.ApplyAccessCondition(accessCondition); request.ApplySequenceNumberCondition(accessCondition); return request; }
/// <summary> /// Constructs a web request to write or clear a range of pages in a page blob. /// </summary> /// <param name="uri">The absolute URI to the blob.</param> /// <param name="timeout">The server timeout interval.</param> /// <param name="properties">The blob's properties.</param> /// <param name="accessCondition">The access condition to apply to the request.</param> /// <returns>A web request to use to perform the operation.</returns> public static HttpRequestMessage PutPage(Uri uri, int? timeout, PageRange pageRange, PageWrite pageWrite, AccessCondition accessCondition, HttpContent content, OperationContext operationContext) { UriQueryBuilder builder = new UriQueryBuilder(); builder.Add(Constants.QueryConstants.Component, "page"); HttpRequestMessage request = HttpRequestMessageFactory.CreateRequestMessage(HttpMethod.Put, uri, timeout, builder, content, operationContext); request.Headers.Add(Constants.HeaderConstants.RangeHeader, pageRange.ToString()); request.Headers.Add(Constants.HeaderConstants.PageWrite, pageWrite.ToString()); request.ApplyAccessCondition(accessCondition); request.ApplySequenceNumberCondition(accessCondition); return request; }
/// <summary> /// Constructs a web request to write or clear a range of pages in a page blob. /// </summary> /// <param name="uri">The absolute URI to the blob.</param> /// <param name="timeout">The server timeout interval.</param> /// <param name="pageRange">The page range, defined by an object of type <see cref="PageRange"/>.</param> /// <param name="pageWrite">A value of type <see cref="PageWrite"/>, indicating the operation to perform on the page blob.</param> /// <param name="accessCondition">The <see cref="AccessCondition"/> to apply to the request.</param> /// <param name="operationContext">An <see cref="OperationContext" /> object for tracking the current operation.</param> /// <returns> /// A web request to use to perform the operation. /// </returns> public static HttpWebRequest PutPage(Uri uri, int? timeout, PageRange pageRange, PageWrite pageWrite, AccessCondition accessCondition, OperationContext operationContext) { UriQueryBuilder builder = new UriQueryBuilder(); builder.Add(Constants.QueryConstants.Component, "page"); HttpWebRequest request = HttpWebRequestFactory.CreateWebRequest(WebRequestMethods.Http.Put, uri, timeout, builder, operationContext); request.ContentLength = 0; request.AddOptionalHeader(Constants.HeaderConstants.RangeHeader, pageRange.ToString()); request.Headers.Add(Constants.HeaderConstants.PageWrite, pageWrite.ToString()); request.ApplyAccessCondition(accessCondition); return request; }