-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AppendBlobClient.getOutputStream(boolean) to overwrite correctly if set to true #33086
AppendBlobClient.getOutputStream(boolean) to overwrite correctly if set to true #33086
Conversation
…to appendBlobOutputStream
…to appendBlobOutputStream
…to appendBlobOutputStream
/azp run java - storage - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
...ge/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobClient.java
Outdated
Show resolved
Hide resolved
public BlobOutputStream getBlobOutputStream(boolean overwrite) { | ||
AppendBlobRequestConditions requestConditions = null; | ||
if (!overwrite) { | ||
if (exists()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to throw here or put the OutputStream into append mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it looks like in .NET when overwrite is false and blob exists, they continue to append. We should probably follow the same logic.
…/blob/specialized/AppendBlobClient.java Co-authored-by: Alan Zimmer <[email protected]>
…bab/azure-sdk-for-java into appendBlobOutputStream
/azp run java - storage - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
...ge/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobClient.java
Show resolved
Hide resolved
API change check APIView has identified API level changes in this PR and created following API reviews. |
/azp run java - storage - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - storage - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
resolves #32602
When
AppendBlobClient.getOutputStream(true)
is called, the existing blob is not overwritten. Instead, new data gets appended to the existing data.Changed javadoc for
AppendBlobClient.getOutputStream()
that specifies new data will be appended to the existing blob (which is the actual correct behavior) instead of getting overwritten.Changed logic for
AppendBlobClient.getOutputStream(boolean)
to create a new blob that will overwrite existing blob ifoverwrite=true
.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines