From cddd90e2f3e0e0129729cd92e2859f57e9aac053 Mon Sep 17 00:00:00 2001 From: Daniel Stolt Date: Fri, 24 Jan 2014 16:21:23 +0100 Subject: [PATCH] #20445: Changing CloudBlobContainerExtensions to use the new CloudBlockBlob.Exists() API instead of causing and swallowing exceptions. Work Item: 20445 --- .../FileSystems/CloudBlobContainerExtensions.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Azure/Services/FileSystems/CloudBlobContainerExtensions.cs b/src/Orchard.Web/Modules/Orchard.Azure/Services/FileSystems/CloudBlobContainerExtensions.cs index eb12d52a9..d31932788 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure/Services/FileSystems/CloudBlobContainerExtensions.cs +++ b/src/Orchard.Web/Modules/Orchard.Azure/Services/FileSystems/CloudBlobContainerExtensions.cs @@ -10,15 +10,7 @@ namespace Orchard.Azure.Services.FileSystems { public static bool BlobExists(this CloudBlobContainer container, string path) { if (String.IsNullOrEmpty(path) || path.Trim() == String.Empty) throw new ArgumentException("Path can't be empty"); - - try { - var blob = container.GetBlockBlobReference(path); - blob.FetchAttributes(); - return true; - } - catch (StorageException) { - return false; - } + return container.GetBlockBlobReference(path).Exists(); } public static void EnsureBlobExists(this CloudBlobContainer container, string path) {