From 319cadaa34c347b05396e2900edecd23e333b390 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Fri, 2 Jul 2021 09:57:26 -0700 Subject: [PATCH 1/3] deprecated api --- .../Azure.Storage.Blobs/src/BlobBaseClient.cs | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index 1c092603dbe72..25b91c8f0cc5c 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -608,6 +608,22 @@ private void SetNameFieldsIfNull() /// /// A will be thrown if /// a failure occurs. + /// + /// This API has been deprecated. Consider the following alternatives: + /// + /// + /// DownloadContent + /// to download relatively small blobs + /// + /// + /// DownloadTo + /// to stream blob content to a path or a + /// + /// + /// DownloadStreaming + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response Download() => @@ -629,6 +645,22 @@ public virtual Response Download() => /// /// A will be thrown if /// a failure occurs. + /// + /// This API has been deprecated. Consider the following alternatives: + /// + /// + /// DownloadContentAsync + /// to download relatively small blobs + /// + /// + /// DownloadToAsync + /// to stream blob content to a path or a + /// + /// + /// DownloadStreamingAsync + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// [EditorBrowsable(EditorBrowsableState.Never)] public virtual async Task> DownloadAsync() => @@ -654,6 +686,22 @@ public virtual async Task> DownloadAsync() => /// /// A will be thrown if /// a failure occurs. + /// + /// This API has been deprecated. Consider the following alternatives: + /// + /// + /// DownloadContent + /// to download relatively small blobs + /// + /// + /// DownloadTo + /// to stream blob content to a path or a + /// + /// + /// DownloadStreaming + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response Download( @@ -683,6 +731,22 @@ public virtual Response Download( /// /// A will be thrown if /// a failure occurs. + /// + /// This API has been deprecated. Consider the following alternatives: + /// + /// + /// DownloadContentAsync + /// to download relatively small blobs + /// + /// + /// DownloadToAsync + /// to stream blob content to a path or a + /// + /// + /// DownloadStreamingAsync + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// [EditorBrowsable(EditorBrowsableState.Never)] public virtual async Task> DownloadAsync( @@ -729,6 +793,22 @@ await DownloadAsync( /// /// A will be thrown if /// a failure occurs. + /// + /// This API has been deprecated. Consider the following alternatives: + /// + /// + /// DownloadContent + /// to download relatively small blobs + /// + /// + /// DownloadTo + /// to stream blob content to a path or a + /// + /// + /// DownloadStreaming + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response Download( @@ -781,6 +861,22 @@ public virtual Response Download( /// /// A will be thrown if /// a failure occurs. + /// + /// This API has been deprecated. Consider the following alternatives: + /// + /// + /// DownloadContentAsync + /// to download relatively small blobs + /// + /// + /// DownloadToAsync + /// to stream blob content to a path or a + /// + /// + /// DownloadStreamingAsync + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// [EditorBrowsable(EditorBrowsableState.Never)] public virtual async Task> DownloadAsync( From ee435eeda5d648757e4f7bcc5db2f9cb0feb22cf Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Fri, 2 Jul 2021 10:08:46 -0700 Subject: [PATCH 2/3] improve downloadcontent and download streaming --- .../Azure.Storage.Blobs/src/BlobBaseClient.cs | 118 +++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index 25b91c8f0cc5c..ab809a3a589f5 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -645,7 +645,7 @@ public virtual Response Download() => /// /// A will be thrown if /// a failure occurs. - /// + /// /// This API has been deprecated. Consider the following alternatives: /// /// @@ -999,6 +999,19 @@ private async Task> DownloadInternal( /// /// A will be thrown if /// a failure occurs. + /// + /// This API gives access directly to network stream that should be disposed after usage. + /// Consider the following alternatives: + /// + /// + /// DownloadContent + /// to download relatively small blobs + /// + /// + /// DownloadTo + /// to stream blob content to a path or a + /// + /// /// public virtual Response DownloadStreaming( HttpRange range = default, @@ -1051,6 +1064,19 @@ public virtual Response DownloadStreaming( /// /// A will be thrown if /// a failure occurs. + /// + /// This API gives access directly to network stream that should be disposed after usage. + /// Consider the following alternatives: + /// + /// + /// DownloadContentAsync + /// to download relatively small blobs + /// + /// + /// DownloadToAsync + /// to stream blob content to a path or a + /// + /// /// public virtual async Task> DownloadStreamingAsync( HttpRange range = default, @@ -1295,6 +1321,21 @@ private async Task> StartDownloadAsync( /// /// A will be thrown if /// a failure occurs. + /// + /// This API is a prefered way to fetch blobs that can fit into memory. + /// The content is provided as that provides a lightweight abstraction for a payload of bytes. + /// It provides convenient helper methods to get out commonly used primitives, such as streams, strings, or bytes. + /// Consider the following alternatives: + /// + /// + /// DownloadTo + /// to stream blob content to a path or a + /// + /// + /// DownloadStreaming + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// public virtual Response DownloadContent() => DownloadContent(CancellationToken.None); @@ -1315,6 +1356,21 @@ public virtual Response DownloadContent() => /// /// A will be thrown if /// a failure occurs. + /// + /// This API is a prefered way to fetch blobs that can fit into memory. + /// The content is provided as that provides a lightweight abstraction for a payload of bytes. + /// It provides convenient helper methods to get out commonly used primitives, such as streams, strings, or bytes. + /// Consider the following alternatives: + /// + /// + /// DownloadToAsync + /// to stream blob content to a path or a + /// + /// + /// DownloadStreamingAsync + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// public virtual async Task> DownloadContentAsync() => await DownloadContentAsync(CancellationToken.None).ConfigureAwait(false); @@ -1339,6 +1395,21 @@ public virtual async Task> DownloadContentAsync() = /// /// A will be thrown if /// a failure occurs. + /// + /// This API is a prefered way to fetch blobs that can fit into memory. + /// The content is provided as that provides a lightweight abstraction for a payload of bytes. + /// It provides convenient helper methods to get out commonly used primitives, such as streams, strings, or bytes. + /// Consider the following alternatives: + /// + /// + /// DownloadTo + /// to stream blob content to a path or a + /// + /// + /// DownloadStreaming + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// public virtual Response DownloadContent( CancellationToken cancellationToken = default) => @@ -1367,6 +1438,21 @@ public virtual Response DownloadContent( /// /// A will be thrown if /// a failure occurs. + /// + /// This API is a prefered way to fetch blobs that can fit into memory. + /// The content is provided as that provides a lightweight abstraction for a payload of bytes. + /// It provides convenient helper methods to get out commonly used primitives, such as streams, strings, or bytes. + /// Consider the following alternatives: + /// + /// + /// DownloadToAsync + /// to stream blob content to a path or a + /// + /// + /// DownloadStreamingAsync + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// public virtual async Task> DownloadContentAsync( CancellationToken cancellationToken) => @@ -1400,6 +1486,21 @@ await DownloadContentAsync( /// /// A will be thrown if /// a failure occurs. + /// + /// This API is a prefered way to fetch blobs that can fit into memory. + /// The content is provided as that provides a lightweight abstraction for a payload of bytes. + /// It provides convenient helper methods to get out commonly used primitives, such as streams, strings, or bytes. + /// Consider the following alternatives: + /// + /// + /// DownloadTo + /// to stream blob content to a path or a + /// + /// + /// DownloadStreaming + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// public virtual Response DownloadContent( BlobRequestConditions conditions = default, @@ -1435,6 +1536,21 @@ public virtual Response DownloadContent( /// /// A will be thrown if /// a failure occurs. + /// + /// This API is a prefered way to fetch blobs that can fit into memory. + /// The content is provided as that provides a lightweight abstraction for a payload of bytes. + /// It provides convenient helper methods to get out commonly used primitives, such as streams, strings, or bytes. + /// Consider the following alternatives: + /// + /// + /// DownloadToAsync + /// to stream blob content to a path or a + /// + /// + /// DownloadStreamingAsync + /// as a replacement to this API. Use it to access network stream directly for any advanced scenario. + /// + /// /// public virtual async Task> DownloadContentAsync( BlobRequestConditions conditions = default, From b2704689bff5d5809c931877fc0d9b70ce96490a Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Fri, 2 Jul 2021 10:10:50 -0700 Subject: [PATCH 3/3] wip --- .../Azure.Storage.Blobs/src/BlobBaseClient.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index ab809a3a589f5..4a76c41eca90f 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -613,7 +613,7 @@ private void SetNameFieldsIfNull() /// /// /// DownloadContent - /// to download relatively small blobs + /// as a prefered way of downloading small blobs that can fit into memory /// /// /// DownloadTo @@ -650,7 +650,7 @@ public virtual Response Download() => /// /// /// DownloadContentAsync - /// to download relatively small blobs + /// as a prefered way of downloading small blobs that can fit into memory /// /// /// DownloadToAsync @@ -691,7 +691,7 @@ public virtual async Task> DownloadAsync() => /// /// /// DownloadContent - /// to download relatively small blobs + /// as a prefered way of downloading small blobs that can fit into memory /// /// /// DownloadTo @@ -736,7 +736,7 @@ public virtual Response Download( /// /// /// DownloadContentAsync - /// to download relatively small blobs + /// as a prefered way of downloading small blobs that can fit into memory /// /// /// DownloadToAsync @@ -798,7 +798,7 @@ await DownloadAsync( /// /// /// DownloadContent - /// to download relatively small blobs + /// as a prefered way of downloading small blobs that can fit into memory /// /// /// DownloadTo @@ -866,7 +866,7 @@ public virtual Response Download( /// /// /// DownloadContentAsync - /// to download relatively small blobs + /// as a prefered way of downloading small blobs that can fit into memory /// /// /// DownloadToAsync @@ -1005,7 +1005,7 @@ private async Task> DownloadInternal( /// /// /// DownloadContent - /// to download relatively small blobs + /// as a prefered way of downloading small blobs that can fit into memory /// /// /// DownloadTo @@ -1070,7 +1070,7 @@ public virtual Response DownloadStreaming( /// /// /// DownloadContentAsync - /// to download relatively small blobs + /// as a prefered way of downloading small blobs that can fit into memory /// /// /// DownloadToAsync