Skip to content

Commit

Permalink
Improve download docs (#22418)
Browse files Browse the repository at this point in the history
* deprecated api

* improve downloadcontent and download streaming

* wip
  • Loading branch information
kasobol-msft authored Jul 2, 2021
1 parent c673045 commit 2d80b9e
Showing 1 changed file with 212 additions and 0 deletions.
212 changes: 212 additions & 0 deletions sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,22 @@ private void SetNameFieldsIfNull()
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
///
/// This API has been deprecated. Consider the following alternatives:
/// <list type="bullet">
/// <item>
/// <term>DownloadContent</term>
/// <description>as a prefered way of downloading small blobs that can fit into memory</description>
/// </item>
/// <item>
/// <term>DownloadTo</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreaming</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response<BlobDownloadInfo> Download() =>
Expand All @@ -629,6 +645,22 @@ public virtual Response<BlobDownloadInfo> Download() =>
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
///
/// This API has been deprecated. Consider the following alternatives:
/// <list type="bullet">
/// <item>
/// <term>DownloadContentAsync</term>
/// <description>as a prefered way of downloading small blobs that can fit into memory</description>
/// </item>
/// <item>
/// <term>DownloadToAsync</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreamingAsync</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual async Task<Response<BlobDownloadInfo>> DownloadAsync() =>
Expand All @@ -654,6 +686,22 @@ public virtual async Task<Response<BlobDownloadInfo>> DownloadAsync() =>
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
///
/// This API has been deprecated. Consider the following alternatives:
/// <list type="bullet">
/// <item>
/// <term>DownloadContent</term>
/// <description>as a prefered way of downloading small blobs that can fit into memory</description>
/// </item>
/// <item>
/// <term>DownloadTo</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreaming</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response<BlobDownloadInfo> Download(
Expand Down Expand Up @@ -683,6 +731,22 @@ public virtual Response<BlobDownloadInfo> Download(
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
///
/// This API has been deprecated. Consider the following alternatives:
/// <list type="bullet">
/// <item>
/// <term>DownloadContentAsync</term>
/// <description>as a prefered way of downloading small blobs that can fit into memory</description>
/// </item>
/// <item>
/// <term>DownloadToAsync</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreamingAsync</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual async Task<Response<BlobDownloadInfo>> DownloadAsync(
Expand Down Expand Up @@ -729,6 +793,22 @@ await DownloadAsync(
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
///
/// This API has been deprecated. Consider the following alternatives:
/// <list type="bullet">
/// <item>
/// <term>DownloadContent</term>
/// <description>as a prefered way of downloading small blobs that can fit into memory</description>
/// </item>
/// <item>
/// <term>DownloadTo</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreaming</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response<BlobDownloadInfo> Download(
Expand Down Expand Up @@ -781,6 +861,22 @@ public virtual Response<BlobDownloadInfo> Download(
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
///
/// This API has been deprecated. Consider the following alternatives:
/// <list type="bullet">
/// <item>
/// <term>DownloadContentAsync</term>
/// <description>as a prefered way of downloading small blobs that can fit into memory</description>
/// </item>
/// <item>
/// <term>DownloadToAsync</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreamingAsync</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual async Task<Response<BlobDownloadInfo>> DownloadAsync(
Expand Down Expand Up @@ -903,6 +999,19 @@ private async Task<Response<BlobDownloadInfo>> DownloadInternal(
/// <remarks>
/// A <see cref="RequestFailedException"/> 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:
/// <list type="bullet">
/// <item>
/// <term>DownloadContent</term>
/// <description>as a prefered way of downloading small blobs that can fit into memory</description>
/// </item>
/// <item>
/// <term>DownloadTo</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// </list>
/// </remarks>
public virtual Response<BlobDownloadStreamingResult> DownloadStreaming(
HttpRange range = default,
Expand Down Expand Up @@ -955,6 +1064,19 @@ public virtual Response<BlobDownloadStreamingResult> DownloadStreaming(
/// <remarks>
/// A <see cref="RequestFailedException"/> 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:
/// <list type="bullet">
/// <item>
/// <term>DownloadContentAsync</term>
/// <description>as a prefered way of downloading small blobs that can fit into memory</description>
/// </item>
/// <item>
/// <term>DownloadToAsync</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// </list>
/// </remarks>
public virtual async Task<Response<BlobDownloadStreamingResult>> DownloadStreamingAsync(
HttpRange range = default,
Expand Down Expand Up @@ -1199,6 +1321,21 @@ private async Task<Response<BlobDownloadStreamingResult>> StartDownloadAsync(
/// <remarks>
/// A <see cref="RequestFailedException"/> 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 <see cref="BinaryData"/> 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:
/// <list type="bullet">
/// <item>
/// <term>DownloadTo</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreaming</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
public virtual Response<BlobDownloadResult> DownloadContent() =>
DownloadContent(CancellationToken.None);
Expand All @@ -1219,6 +1356,21 @@ public virtual Response<BlobDownloadResult> DownloadContent() =>
/// <remarks>
/// A <see cref="RequestFailedException"/> 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 <see cref="BinaryData"/> 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:
/// <list type="bullet">
/// <item>
/// <term>DownloadToAsync</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreamingAsync</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
public virtual async Task<Response<BlobDownloadResult>> DownloadContentAsync() =>
await DownloadContentAsync(CancellationToken.None).ConfigureAwait(false);
Expand All @@ -1243,6 +1395,21 @@ public virtual async Task<Response<BlobDownloadResult>> DownloadContentAsync() =
/// <remarks>
/// A <see cref="RequestFailedException"/> 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 <see cref="BinaryData"/> 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:
/// <list type="bullet">
/// <item>
/// <term>DownloadTo</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreaming</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
public virtual Response<BlobDownloadResult> DownloadContent(
CancellationToken cancellationToken = default) =>
Expand Down Expand Up @@ -1271,6 +1438,21 @@ public virtual Response<BlobDownloadResult> DownloadContent(
/// <remarks>
/// A <see cref="RequestFailedException"/> 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 <see cref="BinaryData"/> 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:
/// <list type="bullet">
/// <item>
/// <term>DownloadToAsync</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreamingAsync</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
public virtual async Task<Response<BlobDownloadResult>> DownloadContentAsync(
CancellationToken cancellationToken) =>
Expand Down Expand Up @@ -1304,6 +1486,21 @@ await DownloadContentAsync(
/// <remarks>
/// A <see cref="RequestFailedException"/> 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 <see cref="BinaryData"/> 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:
/// <list type="bullet">
/// <item>
/// <term>DownloadTo</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreaming</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
public virtual Response<BlobDownloadResult> DownloadContent(
BlobRequestConditions conditions = default,
Expand Down Expand Up @@ -1339,6 +1536,21 @@ public virtual Response<BlobDownloadResult> DownloadContent(
/// <remarks>
/// A <see cref="RequestFailedException"/> 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 <see cref="BinaryData"/> 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:
/// <list type="bullet">
/// <item>
/// <term>DownloadToAsync</term>
/// <description>to stream blob content to a path or a <see cref="Stream"/></description>
/// </item>
/// <item>
/// <term>DownloadStreamingAsync</term>
/// <description>as a replacement to this API. Use it to access network stream directly for any advanced scenario.</description>
/// </item>
/// </list>
/// </remarks>
public virtual async Task<Response<BlobDownloadResult>> DownloadContentAsync(
BlobRequestConditions conditions = default,
Expand Down

0 comments on commit 2d80b9e

Please sign in to comment.