forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug in Open Read, grouped optional parameters (Azure#14511)
- Loading branch information
1 parent
6655f73
commit 8bcc441
Showing
35 changed files
with
2,724 additions
and
8,476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
sdk/storage/Azure.Storage.Blobs/src/Models/BlobOpenReadOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Azure.Storage.Blobs.Specialized; | ||
|
||
namespace Azure.Storage.Blobs.Models | ||
{ | ||
/// <summary> | ||
/// Optional parameters for <see cref="BlobBaseClient.OpenReadAsync(BlobOpenReadOptions, System.Threading.CancellationToken)"/> | ||
/// </summary> | ||
public class BlobOpenReadOptions | ||
{ | ||
/// <summary> | ||
/// The position within the blob to begin the stream. | ||
/// Defaults to the beginning of the blob. | ||
/// </summary> | ||
public long Position { get; set; } | ||
|
||
/// <summary> | ||
/// The buffer size to use when the stream downloads parts | ||
/// of the blob. Defaults to 4 MB. | ||
/// </summary> | ||
public int? BufferSize { get; set; } | ||
|
||
/// <summary> | ||
/// Optional <see cref="BlobRequestConditions"/> to add conditions on | ||
/// the download of the blob. | ||
/// </summary> | ||
public BlobRequestConditions Conditions { get; set; } | ||
|
||
/// <summary> | ||
/// Constructor. | ||
/// </summary> | ||
/// <param name="allowModifications"> | ||
/// If false, a <see cref="RequestFailedException"/> will be thrown if the blob is modified while | ||
/// it is being read from. | ||
/// </param> | ||
public BlobOpenReadOptions(bool allowModifications) | ||
{ | ||
// Setting the Conditions to empty means we won't automatically | ||
// use the ETag as a condition and it will be possible for the blob | ||
// to change while it's being read from. | ||
if (allowModifications) | ||
{ | ||
Conditions = new BlobRequestConditions(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.