Class StorageContentValidationDecodingPolicy

java.lang.Object
com.azure.storage.common.policy.StorageContentValidationDecodingPolicy
All Implemented Interfaces:
com.azure.core.http.policy.HttpPipelinePolicy

public class StorageContentValidationDecodingPolicy extends Object implements com.azure.core.http.policy.HttpPipelinePolicy
HTTP pipeline policy that decodes the storage structured message body returned for downloads when CRC64 content validation is active.

The policy decides when to opt in (via the context key), tells the service to encode the response (via the request header), constructs the decoder and the wrapper response, and translates decoder-level failures (malformed framing, CRC mismatch, premature end-of-stream) into reactive IOException errors.

This policy uses PER_RETRY semantics by default, so each retry produces a fresh response that this policy wraps with a fresh decoder. A CRC failure on one attempt cannot pollute another, and the storage download retry logic (BlobAsyncClientBase.downloadStream...) can resume by reissuing range requests; each new range response is validated end-to-end on its own.

Because the wrapped StructuredMessageDecoder only releases payload bytes after the corresponding segment's CRC has been verified, the DecodedResponse's body Flux is guaranteed to contain only validated bytes – callers never see a byte that could later fail validation, even when retries are involved.

  • Constructor Details

  • Method Details

    • process

      public Mono<com.azure.core.http.HttpResponse> process(com.azure.core.http.HttpPipelineCallContext context, com.azure.core.http.HttpPipelineNextPolicy next)
      Specified by:
      process in interface com.azure.core.http.policy.HttpPipelinePolicy