com.microsoft.azure.storage.Constants.HeaderConstants Java Examples

The following examples show how to use com.microsoft.azure.storage.Constants.HeaderConstants. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlobRequest.java    From azure-storage-android with Apache License 2.0 8 votes vote down vote up
/**
 * Generates a web request to abort a copy operation.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} object that specifies execution options such as retry policy and timeout
 *            settings for the operation. Specify <code>null</code> to use the request options specified on the
 *            {@link CloudBlobClient}.
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @param accessCondition
 *            The access condition to apply to the request. Only lease conditions are supported for this operation.
 * @param copyId
 *            A <code>String</code> object that identifying the copy operation.
 * @return a HttpURLConnection configured for the operation.
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 * @throws IOException
 * @throws URISyntaxException
 */
public static HttpURLConnection abortCopy(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final String copyId)
        throws StorageException, IOException, URISyntaxException {

    final UriQueryBuilder builder = new UriQueryBuilder();

    builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.COPY);
    builder.add(Constants.QueryConstants.COPY_ID, copyId);

    final HttpURLConnection request = BaseRequest.createURLConnection(uri, blobOptions, builder, opContext);

    request.setFixedLengthStreamingMode(0);
    request.setDoOutput(true);
    request.setRequestMethod(Constants.HTTP_PUT);

    request.setRequestProperty(Constants.HeaderConstants.COPY_ACTION_HEADER,
            Constants.HeaderConstants.COPY_ACTION_ABORT);

    if (accessCondition != null) {
        accessCondition.applyLeaseConditionToRequest(request);
    }

    return request;
}
 
Example #2
Source File: BlobRequest.java    From azure-storage-android with Apache License 2.0 6 votes vote down vote up
/**
 * Adds the Range Header for Blob Service Operations.
 * 
 * @param request
 *            The request to add the range header to.
 * @param offset
 *            Starting byte of the range.
 * @param count
 *            Number of bytes in the range.
 */
private static void addRange(HttpURLConnection request, Long offset, Long count) {
    if (offset != null) {
        long rangeStart = offset;
        long rangeEnd;
        if (count != null) {
            rangeEnd = offset + count - 1;
            request.setRequestProperty(Constants.HeaderConstants.STORAGE_RANGE_HEADER, String.format(
                    Utility.LOCALE_US, Constants.HeaderConstants.RANGE_HEADER_FORMAT, rangeStart, rangeEnd));
        }
        else {
            request.setRequestProperty(Constants.HeaderConstants.STORAGE_RANGE_HEADER, String.format(
                    Utility.LOCALE_US, Constants.HeaderConstants.BEGIN_RANGE_HEADER_FORMAT, rangeStart));
        }
    }
}
 
Example #3
Source File: ResponseReceivedMetricUpdater.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Get the content length of the request in the given HTTP connection.
 * @param connection The connection.
 * @return The content length, or zero if not found.
 */
private long getRequestContentLength(HttpURLConnection connection) {
  String lengthString = connection.getRequestProperty(
      HeaderConstants.CONTENT_LENGTH);
  if (lengthString != null){
    return Long.parseLong(lengthString);
  }
  else{
    return 0;
  }
}
 
Example #4
Source File: ResponseReceivedMetricUpdater.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Get the content length of the request in the given HTTP connection.
 * @param connection The connection.
 * @return The content length, or zero if not found.
 */
private long getRequestContentLength(HttpURLConnection connection) {
  String lengthString = connection.getRequestProperty(
      HeaderConstants.CONTENT_LENGTH);
  if (lengthString != null){
    return Long.parseLong(lengthString);
  }
  else{
    return 0;
  }
}
 
Example #5
Source File: BlobRequest.java    From azure-storage-android with Apache License 2.0 5 votes vote down vote up
/**
 * Adds the properties.
 * 
 * @param request
 *            The request.
 * @param properties
 *            The properties object.
 */
private static void addProperties(final HttpURLConnection request, BlobProperties properties) {
    BaseRequest.addOptionalHeader(request, Constants.HeaderConstants.CACHE_CONTROL_HEADER,
            properties.getCacheControl());
    BaseRequest.addOptionalHeader(request, BlobConstants.CONTENT_DISPOSITION_HEADER,
            properties.getContentDisposition());
    BaseRequest.addOptionalHeader(request, BlobConstants.CONTENT_ENCODING_HEADER, properties.getContentEncoding());
    BaseRequest.addOptionalHeader(request, BlobConstants.CONTENT_LANGUAGE_HEADER, properties.getContentLanguage());
    BaseRequest.addOptionalHeader(request, BlobConstants.BLOB_CONTENT_MD5_HEADER, properties.getContentMD5());
    BaseRequest.addOptionalHeader(request, BlobConstants.CONTENT_TYPE_HEADER, properties.getContentType());
}
 
Example #6
Source File: BlobRequest.java    From azure-storage-android with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs a HttpURLConnection to delete the blob, Sign with no length specified.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} object that specifies execution options such as retry policy and timeout
 *            settings for the operation. Specify <code>null</code> to use the request options specified on the
 *            {@link CloudBlobClient}.
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @param accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param snapshotVersion
 *            The snapshot version, if the blob is a snapshot.
 * @param deleteSnapshotsOption
 *            A set of options indicating whether to delete only blobs, only snapshots, or both.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection deleteBlob(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final String snapshotVersion,
        final DeleteSnapshotsOption deleteSnapshotsOption) throws IOException, URISyntaxException, StorageException {

    if (snapshotVersion != null && deleteSnapshotsOption != DeleteSnapshotsOption.NONE) {
        throw new IllegalArgumentException(String.format(SR.DELETE_SNAPSHOT_NOT_VALID_ERROR,
                "deleteSnapshotsOption", "snapshot"));
    }

    final UriQueryBuilder builder = new UriQueryBuilder();
    BlobRequest.addSnapshot(builder, snapshotVersion);
    final HttpURLConnection request = BaseRequest.delete(uri, blobOptions, builder, opContext);

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

    switch (deleteSnapshotsOption) {
        case NONE:
            // nop
            break;
        case INCLUDE_SNAPSHOTS:
            request.setRequestProperty(Constants.HeaderConstants.DELETE_SNAPSHOT_HEADER,
                    BlobConstants.INCLUDE_SNAPSHOTS_VALUE);
            break;
        case DELETE_SNAPSHOTS_ONLY:
            request.setRequestProperty(Constants.HeaderConstants.DELETE_SNAPSHOT_HEADER,
                    BlobConstants.SNAPSHOTS_ONLY_VALUE);
            break;
        default:
            break;
    }

    return request;
}
 
Example #7
Source File: BlobRequest.java    From azure-storage-android with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs a HttpURLConnection to Acquire,Release,Break, or Renew a blob/container lease. Sign with 0 length.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} object that specifies execution options such as retry policy and timeout
 *            settings for the operation. Specify <code>null</code> to use the request options specified on the
 *            {@link CloudBlobClient}.
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @param accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param action
 *            the LeaseAction to perform
 * @param proposedLeaseId
 *            A <code>String</code> that represents the proposed lease ID for the new lease,
 *            or null if no lease ID is proposed.
 * @param breakPeriodInSeconds
 *            Specifies the amount of time to allow the lease to remain, in seconds.
 *            If null, the break period is the remainder of the current lease, or zero for infinite leases.
 * @param visibilityTimeoutInSeconds
 *            Specifies the the span of time for which to acquire the lease, in seconds.
 *            If null, an infinite lease will be acquired. If not null, this must be greater than zero.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
private static HttpURLConnection lease(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final LeaseAction action,
        final Integer leaseTimeInSeconds, final String proposedLeaseId, final Integer breakPeriodInSeconds,
        final UriQueryBuilder builder) throws IOException, URISyntaxException, StorageException {
    final HttpURLConnection request = createURLConnection(uri, builder, blobOptions, opContext);

    request.setDoOutput(true);
    request.setRequestMethod(Constants.HTTP_PUT);
    request.setFixedLengthStreamingMode(0);
    request.setRequestProperty(HeaderConstants.LEASE_ACTION_HEADER, action.toString());

    // Lease duration should only be sent for acquire.
    if (action == LeaseAction.ACQUIRE) {
        // Assert lease duration is in bounds
        if (leaseTimeInSeconds != null && leaseTimeInSeconds != -1) {
            Utility.assertInBounds("leaseTimeInSeconds", leaseTimeInSeconds, Constants.LEASE_DURATION_MIN,
                    Constants.LEASE_DURATION_MAX);
        }

        request.setRequestProperty(HeaderConstants.LEASE_DURATION, leaseTimeInSeconds == null ? "-1"
                : leaseTimeInSeconds.toString());
    }

    if (proposedLeaseId != null) {
        request.setRequestProperty(HeaderConstants.PROPOSED_LEASE_ID_HEADER, proposedLeaseId);
    }

    if (breakPeriodInSeconds != null) {
        // Assert lease break period is in bounds
        Utility.assertInBounds("breakPeriodInSeconds", breakPeriodInSeconds, Constants.LEASE_BREAK_PERIOD_MIN,
                Constants.LEASE_BREAK_PERIOD_MAX);
        request.setRequestProperty(HeaderConstants.LEASE_BREAK_PERIOD_HEADER, breakPeriodInSeconds.toString());
    }

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }
    return request;
}
 
Example #8
Source File: BlobRequest.java    From azure-storage-android with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a request to copy a blob, Sign with 0 length.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} object that specifies execution options such as retry policy and timeout
 *            settings for the operation. Specify <code>null</code> to use the request options specified on the
 *            {@link CloudBlobClient}.
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @param sourceAccessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the source blob.
 * @param destinationAccessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the destination blob.
 * @param source
 *            The canonical path to the source blob, in the form /<account-name>/<container-name>/<blob-name>.
 * @param sourceSnapshotID
 *            The snapshot version, if the source blob is a snapshot.
 * @param incrementalCopy
 *            A boolean indicating whether or not this is an incremental copy.
 * @param premiumPageBlobTier
 *            A {@link PremiumPageBlobTier} object which represents the tier of the blob.
 * @return a HttpURLConnection configured for the operation.
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 * @throws IOException
 * @throws URISyntaxException
 */
public static HttpURLConnection copyFrom(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition sourceAccessCondition,
        final AccessCondition destinationAccessCondition, String source, final String sourceSnapshotID,
        final boolean incrementalCopy, final PremiumPageBlobTier premiumPageBlobTier)
        throws StorageException, IOException, URISyntaxException {

    if (sourceSnapshotID != null) {
        source = source.concat("?snapshot=");
        source = source.concat(sourceSnapshotID);
    }

    UriQueryBuilder builder = null;
    if (incrementalCopy)
    {
        builder = new UriQueryBuilder();
        builder.add(Constants.QueryConstants.COMPONENT, "incrementalcopy");
    }

    final HttpURLConnection request = BaseRequest.createURLConnection(uri, blobOptions, builder, opContext);

    request.setFixedLengthStreamingMode(0);
    request.setDoOutput(true);
    request.setRequestMethod(Constants.HTTP_PUT);

    request.setRequestProperty(Constants.HeaderConstants.COPY_SOURCE_HEADER, source);

    if (premiumPageBlobTier != null) {
        request.setRequestProperty(BlobConstants.ACCESS_TIER_HEADER, String.valueOf(premiumPageBlobTier));
    }

    if (sourceAccessCondition != null) {
        sourceAccessCondition.applySourceConditionToRequest(request);
    }

    if (destinationAccessCondition != null) {
        destinationAccessCondition.applyConditionToRequest(request);
    }

    return request;
}
 
Example #9
Source File: BlobRequest.java    From azure-storage-android with Apache License 2.0 4 votes vote down vote up
/**
 * Constructs a HttpURLConnection to upload a blob. Sign with blob length, or -1 for pageblob create.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} object that specifies execution options such as retry policy and timeout
 *            settings for the operation. Specify <code>null</code> to use the request options specified on the
 *            {@link CloudBlobClient}.
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @param accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param properties
 *            The properties to set for the blob.
 * @param blobType
 *            The type of the blob.
 * @param pageBlobSize
 *            For a page blob, the size of the blob. This parameter is ignored for block blobs.
 * @param premiumPageBlobTier
 *            A {@link PremiumPageBlobTier} object representing the tier to set.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection putBlob(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final BlobProperties properties,
        final BlobType blobType, final long pageBlobSize, final PremiumPageBlobTier premiumPageBlobTier) throws IOException, URISyntaxException, StorageException {
    if (blobType == BlobType.UNSPECIFIED) {
        throw new IllegalArgumentException(SR.BLOB_TYPE_NOT_DEFINED);
    }

    final HttpURLConnection request = createURLConnection(uri, null, blobOptions, opContext);

    request.setDoOutput(true);

    request.setRequestMethod(Constants.HTTP_PUT);

    addProperties(request, properties);

    if (blobType == BlobType.PAGE_BLOB) {
        request.setFixedLengthStreamingMode(0);
        request.setRequestProperty(Constants.HeaderConstants.CONTENT_LENGTH, "0");

        request.setRequestProperty(BlobConstants.BLOB_TYPE_HEADER, BlobConstants.PAGE_BLOB);
        request.setRequestProperty(BlobConstants.SIZE, String.valueOf(pageBlobSize));

        if (premiumPageBlobTier != null)
        {
            request.setRequestProperty(BlobConstants.ACCESS_TIER_HEADER, String.valueOf(premiumPageBlobTier));
        }

        properties.setLength(pageBlobSize);
    }
    else if (blobType == BlobType.BLOCK_BLOB){
        request.setRequestProperty(BlobConstants.BLOB_TYPE_HEADER, BlobConstants.BLOCK_BLOB);
    }
    else if (blobType == BlobType.APPEND_BLOB){
        request.setFixedLengthStreamingMode(0);
        request.setRequestProperty(BlobConstants.BLOB_TYPE_HEADER, BlobConstants.APPEND_BLOB);
        request.setRequestProperty(Constants.HeaderConstants.CONTENT_LENGTH, "0");
    }

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

    return request;
}
 
Example #10
Source File: BlobRequest.java    From azure-storage-android with Apache License 2.0 4 votes vote down vote up
/**
 * Constructs a HttpURLConnection to set the the tier on a page blob.
 * This API is only supported for premium accounts.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} object that specifies execution options such as retry policy and timeout
 *            settings for the operation. Specify <code>null</code> to use the request options specified on the
 *            {@link CloudBlobClient}.
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @param premiumBlobTier
 *            A {@link PremiumPageBlobTier} object representing the tier to set.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection setBlobTier(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final String premiumBlobTier)
        throws IOException, URISyntaxException, StorageException {
    final UriQueryBuilder builder = new UriQueryBuilder();
    builder.add(Constants.QueryConstants.COMPONENT, TIER_QUERY_ELEMENT_NAME);

    final HttpURLConnection request = createURLConnection(uri, builder, blobOptions, opContext);

    request.setDoOutput(true);
    request.setRequestMethod(Constants.HTTP_PUT);
    request.setFixedLengthStreamingMode(0);
    request.setRequestProperty(Constants.HeaderConstants.CONTENT_LENGTH, "0");
    request.setRequestProperty(BlobConstants.ACCESS_TIER_HEADER, premiumBlobTier);

    return request;
}
 
Example #11
Source File: BlobRequest.java    From azure-storage-android with Apache License 2.0 3 votes vote down vote up
/**
 * Constructs a HttpURLConnection to download the blob, Sign with no length specified.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} object that specifies execution options such as retry policy and timeout
 *            settings for the operation. Specify <code>null</code> to use the request options specified on the
 *            {@link CloudBlobClient}.
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @param accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param snapshotVersion
 *            The snapshot version, if the blob is a snapshot.
 * @param offset
 *            The offset at which to begin returning content.
 * @param count
 *            The number of bytes to return.
 * @param requestRangeContentMD5
 *            If set to true, request an MD5 header for the specified range.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection getBlob(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final String snapshotVersion,
        final Long offset, final Long count, boolean requestRangeContentMD5) throws IOException,
        URISyntaxException, StorageException {

    if (offset != null && requestRangeContentMD5) {
        Utility.assertNotNull("count", count);
        Utility.assertInBounds("count", count, 1, Constants.MAX_BLOCK_SIZE);
    }

    final UriQueryBuilder builder = new UriQueryBuilder();
    BlobRequest.addSnapshot(builder, snapshotVersion);
    final HttpURLConnection request = BaseRequest.createURLConnection(uri, blobOptions, builder, opContext);
    request.setRequestMethod(Constants.HTTP_GET);

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

    addRange(request, offset, count);

    if (offset != null && requestRangeContentMD5) {
        request.setRequestProperty(Constants.HeaderConstants.RANGE_GET_CONTENT_MD5, Constants.TRUE);
    }

    return request;
}
 
Example #12
Source File: BlobRequest.java    From azure-storage-android with Apache License 2.0 3 votes vote down vote up
/**
 * Constructs a HttpURLConnection to upload a page. Sign with page length for update, or 0 for clear.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} object that specifies execution options such as retry policy and timeout
 *            settings for the operation. Specify <code>null</code> to use the request options specified on the
 *            {@link CloudBlobClient}.
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @param accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param pageRange
 *            A {@link PageRange} object that represents the page range.
 * @param operationType
 *            A {@link PageOperationType} object that represents the page range operation type.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection putPage(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final PageRange pageRange,
        final PageOperationType operationType) throws IOException, URISyntaxException, StorageException {
    final UriQueryBuilder builder = new UriQueryBuilder();
    builder.add(Constants.QueryConstants.COMPONENT, PAGE_QUERY_ELEMENT_NAME);

    final HttpURLConnection request = createURLConnection(uri, builder, blobOptions, opContext);

    request.setDoOutput(true);
    request.setRequestMethod(Constants.HTTP_PUT);

    if (operationType == PageOperationType.CLEAR) {
        request.setFixedLengthStreamingMode(0);
    }

    // Page write is either update or clean; required
    request.setRequestProperty(BlobConstants.PAGE_WRITE, operationType.toString());
    request.setRequestProperty(Constants.HeaderConstants.STORAGE_RANGE_HEADER, pageRange.toString());

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
        accessCondition.applySequenceConditionToRequest(request);
    }

    return request;
}