@@ -518,22 +518,21 @@ public Mono<Response<Boolean>> existsWithResponse() {
518
518
}
519
519
520
520
Mono <Response <Boolean >> existsWithResponse (Context context ) {
521
- return this .getPropertiesWithResponse ( null , context )
521
+ return this .getPropertiesWithResponseNoHeaders ( context )
522
522
.map (cp -> (Response <Boolean >) new SimpleResponse <>(cp , true ))
523
- .onErrorResume (t -> t instanceof BlobStorageException
524
- && BlobErrorCode .BLOB_USES_CUSTOMER_SPECIFIED_ENCRYPTION
525
- .equals (((BlobStorageException ) t ).getErrorCode ()),
526
- t -> {
527
- HttpResponse response = ((BlobStorageException ) t ).getResponse ();
523
+ .onErrorResume (BlobStorageException .class , e -> {
524
+ if (BlobErrorCode .BLOB_USES_CUSTOMER_SPECIFIED_ENCRYPTION .equals (e .getErrorCode ())) {
525
+ HttpResponse response = e .getResponse ();
528
526
return Mono .just (new SimpleResponse <>(response .getRequest (), response .getStatusCode (),
529
527
response .getHeaders (), true ));
530
- })
531
- .onErrorResume (t -> t instanceof BlobStorageException && ((BlobStorageException ) t ).getStatusCode () == 404 ,
532
- t -> {
533
- HttpResponse response = ((BlobStorageException ) t ).getResponse ();
528
+ } else if (e .getStatusCode () == 404 ) {
529
+ HttpResponse response = e .getResponse ();
534
530
return Mono .just (new SimpleResponse <>(response .getRequest (), response .getStatusCode (),
535
531
response .getHeaders (), false ));
536
- });
532
+ } else {
533
+ return Mono .error (e );
534
+ }
535
+ });
537
536
}
538
537
539
538
/**
@@ -892,9 +891,8 @@ public Mono<Response<Void>> abortCopyFromUrlWithResponse(String copyId, String l
892
891
}
893
892
894
893
Mono <Response <Void >> abortCopyFromUrlWithResponse (String copyId , String leaseId , Context context ) {
895
- return this .azureBlobStorage .getBlobs ().abortCopyFromURLWithResponseAsync (
896
- containerName , blobName , copyId , null , leaseId , null , context )
897
- .map (response -> new SimpleResponse <>(response , null ));
894
+ return this .azureBlobStorage .getBlobs ().abortCopyFromURLNoCustomHeadersWithResponseAsync (
895
+ containerName , blobName , copyId , null , leaseId , null , context );
898
896
}
899
897
900
898
/**
@@ -1675,11 +1673,11 @@ Mono<Response<Void>> deleteWithResponse(DeleteSnapshotsOptionType deleteBlobSnap
1675
1673
BlobRequestConditions requestConditions , Context context ) {
1676
1674
requestConditions = requestConditions == null ? new BlobRequestConditions () : requestConditions ;
1677
1675
1678
- return this .azureBlobStorage .getBlobs ().deleteWithResponseAsync (containerName , blobName , snapshot , versionId ,
1679
- null , requestConditions .getLeaseId (), deleteBlobSnapshotOptions , requestConditions . getIfModifiedSince () ,
1680
- requestConditions .getIfUnmodifiedSince (), requestConditions .getIfMatch (),
1681
- requestConditions .getIfNoneMatch (), requestConditions .getTagsConditions (), null , null , context )
1682
- . map ( response -> new SimpleResponse <>( response , null ) );
1676
+ return this .azureBlobStorage .getBlobs ().deleteNoCustomHeadersWithResponseAsync (containerName , blobName ,
1677
+ snapshot , versionId , null , requestConditions .getLeaseId (), deleteBlobSnapshotOptions ,
1678
+ requestConditions .getIfModifiedSince (), requestConditions .getIfUnmodifiedSince (),
1679
+ requestConditions .getIfMatch (), requestConditions .getIfNoneMatch (), requestConditions . getTagsConditions (),
1680
+ null , null , context );
1683
1681
}
1684
1682
1685
1683
/**
@@ -1821,15 +1819,22 @@ Mono<Response<BlobProperties>> getPropertiesWithResponse(BlobRequestConditions r
1821
1819
requestConditions = requestConditions == null ? new BlobRequestConditions () : requestConditions ;
1822
1820
context = context == null ? Context .NONE : context ;
1823
1821
1824
- return this .azureBlobStorage .getBlobs ().getPropertiesWithResponseAsync (
1825
- containerName , blobName , snapshot , versionId , null , requestConditions .getLeaseId (),
1826
- requestConditions .getIfModifiedSince (),
1827
- requestConditions .getIfUnmodifiedSince (), requestConditions .getIfMatch () ,
1828
- requestConditions . getIfNoneMatch (), requestConditions . getTagsConditions (), null , customerProvidedKey , context )
1822
+ return this .azureBlobStorage .getBlobs ().getPropertiesWithResponseAsync (containerName , blobName , snapshot ,
1823
+ versionId , null , requestConditions .getLeaseId (), requestConditions . getIfModifiedSince (),
1824
+ requestConditions .getIfUnmodifiedSince (), requestConditions . getIfMatch (),
1825
+ requestConditions .getIfNoneMatch (), requestConditions .getTagsConditions (), null , customerProvidedKey ,
1826
+ context )
1829
1827
.map (rb -> new SimpleResponse <>(rb , BlobPropertiesConstructorProxy
1830
1828
.create (new BlobPropertiesInternalGetProperties (rb .getDeserializedHeaders ()))));
1831
1829
}
1832
1830
1831
+ Mono <Response <Void >> getPropertiesWithResponseNoHeaders (Context context ) {
1832
+ context = context == null ? Context .NONE : context ;
1833
+
1834
+ return this .azureBlobStorage .getBlobs ().getPropertiesNoCustomHeadersWithResponseAsync (containerName , blobName ,
1835
+ snapshot , versionId , null , null , null , null , null , null , null , null , customerProvidedKey , context );
1836
+ }
1837
+
1833
1838
/**
1834
1839
* Changes a blob's HTTP header properties. if only one HTTP header is updated, the others will all be erased. In
1835
1840
* order to preserve existing values, they must be passed alongside the header being changed.
@@ -1895,11 +1900,10 @@ Mono<Response<Void>> setHttpHeadersWithResponse(BlobHttpHeaders headers, BlobReq
1895
1900
Context context ) {
1896
1901
requestConditions = requestConditions == null ? new BlobRequestConditions () : requestConditions ;
1897
1902
1898
- return this .azureBlobStorage .getBlobs ().setHttpHeadersWithResponseAsync (
1899
- containerName , blobName , null , requestConditions .getLeaseId (), requestConditions .getIfModifiedSince (),
1903
+ return this .azureBlobStorage .getBlobs ().setHttpHeadersNoCustomHeadersWithResponseAsync ( containerName , blobName ,
1904
+ null , requestConditions .getLeaseId (), requestConditions .getIfModifiedSince (),
1900
1905
requestConditions .getIfUnmodifiedSince (), requestConditions .getIfMatch (),
1901
- requestConditions .getIfNoneMatch (), requestConditions .getTagsConditions (), null , headers , context )
1902
- .map (response -> new SimpleResponse <>(response , null ));
1906
+ requestConditions .getIfNoneMatch (), requestConditions .getTagsConditions (), null , headers , context );
1903
1907
}
1904
1908
1905
1909
/**
@@ -1964,12 +1968,11 @@ Mono<Response<Void>> setMetadataWithResponse(Map<String, String> metadata, BlobR
1964
1968
requestConditions = requestConditions == null ? new BlobRequestConditions () : requestConditions ;
1965
1969
context = context == null ? Context .NONE : context ;
1966
1970
1967
- return this .azureBlobStorage .getBlobs ().setMetadataWithResponseAsync (
1968
- containerName , blobName , null , metadata , requestConditions .getLeaseId (), requestConditions .getIfModifiedSince (),
1971
+ return this .azureBlobStorage .getBlobs ().setMetadataNoCustomHeadersWithResponseAsync ( containerName , blobName ,
1972
+ null , metadata , requestConditions .getLeaseId (), requestConditions .getIfModifiedSince (),
1969
1973
requestConditions .getIfUnmodifiedSince (), requestConditions .getIfMatch (),
1970
1974
requestConditions .getIfNoneMatch (), requestConditions .getTagsConditions (), null , customerProvidedKey ,
1971
- encryptionScope , context )
1972
- .map (response -> new SimpleResponse <>(response , null ));
1975
+ encryptionScope , context );
1973
1976
}
1974
1977
1975
1978
/**
@@ -2103,9 +2106,9 @@ Mono<Response<Void>> setTagsWithResponse(BlobSetTagsOptions options, Context con
2103
2106
}
2104
2107
}
2105
2108
BlobTags t = new BlobTags ().setBlobTagSet (tagList );
2106
- return this .azureBlobStorage .getBlobs ().setTagsWithResponseAsync (containerName , blobName , null , versionId ,
2107
- null , null , null , requestConditions .getTagsConditions (), requestConditions .getLeaseId (), t , context )
2108
- . map ( response -> new SimpleResponse <>( response , null ) );
2109
+ return this .azureBlobStorage .getBlobs ().setTagsNoCustomHeadersWithResponseAsync (containerName , blobName , null ,
2110
+ versionId , null , null , null , requestConditions .getTagsConditions (), requestConditions .getLeaseId (), t ,
2111
+ context );
2109
2112
}
2110
2113
2111
2114
/**
@@ -2277,10 +2280,9 @@ public Mono<Response<Void>> setAccessTierWithResponse(BlobSetAccessTierOptions o
2277
2280
Mono <Response <Void >> setTierWithResponse (BlobSetAccessTierOptions options , Context context ) {
2278
2281
StorageImplUtils .assertNotNull ("options" , options );
2279
2282
2280
- return this .azureBlobStorage .getBlobs ().setTierWithResponseAsync (
2281
- containerName , blobName , options .getTier (), snapshot , versionId , null ,
2282
- options .getPriority (), null , options .getLeaseId (), options .getTagsConditions (), context )
2283
- .map (response -> new SimpleResponse <>(response , null ));
2283
+ return this .azureBlobStorage .getBlobs ().setTierNoCustomHeadersWithResponseAsync (containerName , blobName ,
2284
+ options .getTier (), snapshot , versionId , null , options .getPriority (), null , options .getLeaseId (),
2285
+ options .getTagsConditions (), context );
2284
2286
}
2285
2287
2286
2288
/**
@@ -2331,8 +2333,8 @@ public Mono<Response<Void>> undeleteWithResponse() {
2331
2333
}
2332
2334
2333
2335
Mono <Response <Void >> undeleteWithResponse (Context context ) {
2334
- return this .azureBlobStorage .getBlobs ().undeleteWithResponseAsync (containerName , blobName , null ,
2335
- null , context ). map ( response -> new SimpleResponse <>( response , null )) ;
2336
+ return this .azureBlobStorage .getBlobs ().undeleteNoCustomHeadersWithResponseAsync (containerName , blobName , null ,
2337
+ null , context );
2336
2338
}
2337
2339
2338
2340
/**
@@ -2772,9 +2774,8 @@ public Mono<Response<Void>> deleteImmutabilityPolicyWithResponse() {
2772
2774
2773
2775
Mono <Response <Void >> deleteImmutabilityPolicyWithResponse (Context context ) {
2774
2776
context = context == null ? Context .NONE : context ;
2775
- return this .azureBlobStorage .getBlobs ().deleteImmutabilityPolicyWithResponseAsync (containerName , blobName ,
2776
- null , null , context )
2777
- .map (response -> new SimpleResponse <>(response , null ));
2777
+ return this .azureBlobStorage .getBlobs ()
2778
+ .deleteImmutabilityPolicyNoCustomHeadersWithResponseAsync (containerName , blobName , null , null , context );
2778
2779
}
2779
2780
2780
2781
/**
0 commit comments