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

BlobURL : getProperties : HEAD #28

Closed
tiagocpontesp opened this issue Nov 28, 2018 · 3 comments
Closed

BlobURL : getProperties : HEAD #28

tiagocpontesp opened this issue Nov 28, 2018 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@tiagocpontesp
Copy link

There seems to be no mapping to check for the existence of block blobs.

@XiaoningLiu XiaoningLiu self-assigned this Nov 29, 2018
@XiaoningLiu XiaoningLiu added the question Further information is requested label Nov 29, 2018
@XiaoningLiu
Copy link
Member

Hi @tiagocpontesp

Well, you are correct. Methods provided in BlobURL and other XXURL classes are 1:1 mapping to Azure Storage all provided RESTful APIs. There is not "check blob existing" RESTful API provided, so not in the SDK.

The easy way is for a quick check is to call BlobURL.getProperties() and catch the error, if the statusCode is 404. So the blob doesn't exist.

BTW, in which scenario, do you need to check a blob existence?

@tiagocpontesp
Copy link
Author

tiagocpontesp commented Dec 1, 2018

Hi @XiaoningLiu :)
I'm developing a migration process. I'd rather not re-upload previously uploaded blobs, and this would save me some work.
BlobURL.getProperties(Aborter.timeout(TIMEOUT)) seems to hang when nonexistent -- It should get rejected with the error, right?

@tiagocpontesp
Copy link
Author

I can't replicate this anymore. All's good -- getting back a RestError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants