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

GetEtagAsync #6577

Merged
merged 2 commits into from
Oct 18, 2018
Merged

GetEtagAsync #6577

merged 2 commits into from
Oct 18, 2018

Conversation

cristinamanum
Copy link
Contributor

Add an api for reading the etag for an azure blob.

string folderName,
string fileName)
{
return await Task.FromResult<string>(null);
Copy link
Member

Choose a reason for hiding this comment

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

It would be clearer to throw NotImplementedException.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

fileName = fileName ?? throw new ArgumentNullException(nameof(fileName));

var container = await GetContainerAsync(folderName);
var blob = container.GetBlobReference(fileName);
Copy link
Member

Choose a reason for hiding this comment

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

When would this return null?

Copy link
Contributor

Choose a reason for hiding this comment

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

If the blob doesn't exist, FetchAttributesAsync will throw. If the intended behavior is to return null if the blob doesn't exist, I'd rename the method. Maybe something like GetETagOrNullAsync

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the name and also to catch the case of FetchAttributesAsync throwing.

@@ -426,6 +426,24 @@ public async Task<Uri> GetFileReadUriAsync(string folderName, string fileName, D
}
}

public async Task<string> GetETagAsync(
Copy link
Member

Choose a reason for hiding this comment

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

Don't we need a method that calls this in the package file service?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would not add it until needed.

@cristinamanum cristinamanum merged commit fa40f54 into dev Oct 18, 2018
@cristinamanum cristinamanum deleted the cmanuetag branch November 9, 2018 19:29
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.

4 participants