Skip to content
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

Fix Upload From File Tests #7476

Merged

Conversation

alzimmermsft
Copy link
Member

This PR is a follow-up to #7403.

Removed the use of FluxUtil.writeFile to write the blob download to disk based on the root cause found in PR 7403.

…erlying ByteBuffer may be reclaimed before written
@alzimmermsft
Copy link
Member Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines +654 to +656
def outStream = new FileOutputStream(outFile)
outStream.write(FluxUtil.collectBytesInByteBufferStream(blobAsyncClient.download()).block())
outStream.close()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be simplified by using try-with-resources pattern:

new FileOutputStream(outFile).with { outStream ->
      outStream.write(FluxUtil.collectBytesInByteBufferStream(blobAsyncClient.download()).block());
}

@alzimmermsft alzimmermsft merged commit ee1925d into Azure:master Jan 15, 2020
@alzimmermsft alzimmermsft deleted the AzStorage_FixUploadFromFileFailures branch January 15, 2020 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants