public static IEnumerable <BlobInterface> ListAllBlobInterfaces(string storageAccount, string domain) { if (!storedBlobSets.ContainsKey(storageAccount) || DateTime.Now - storedBlobSets[storageAccount].Item1 > BlobListInterval) { try { var blobsInStorageAccount = Directory.GetFiles(Path.Combine(storageAccount, domain)).Select(x => x.Split('\\').Last()).Select(x => StoredBlobInterfaces.ContainsKey(x) ? StoredBlobInterfaces[x] : (StoredBlobInterfaces[x] = new BlobInterface(storageAccount, domain, x))); storedBlobSets[storageAccount] = new Tuple <DateTime, IEnumerable <BlobInterface> >(DateTime.Now, blobsInStorageAccount); } catch { Trace.WriteLine("FAILED TO LIST BLOBS: StorageAccount[" + storageAccount + "] Domain[" + domain + "]"); } } return(storedBlobSets[storageAccount].Item2); }
public static IEnumerable<BlobInterface> ListAllBlobInterfaces(string storageAccount, string domain) { if (!storedBlobSets.ContainsKey(storageAccount) || DateTime.Now - storedBlobSets[storageAccount].Item1 > BlobListInterval) { try { var blobsInStorageAccount = Directory.GetFiles(Path.Combine(storageAccount, domain)).Select(x => x.Split('\\').Last()).Select(x => StoredBlobInterfaces.ContainsKey(x) ? StoredBlobInterfaces[x] : (StoredBlobInterfaces[x] = new BlobInterface(storageAccount, domain, x))); storedBlobSets[storageAccount] = new Tuple<DateTime, IEnumerable<BlobInterface>>(DateTime.Now, blobsInStorageAccount); } catch { Trace.WriteLine("FAILED TO LIST BLOBS: StorageAccount[" + storageAccount + "] Domain[" + domain + "]"); } } return storedBlobSets[storageAccount].Item2; }
public static IEnumerable <BlobInterface> GetBlobInterfacesByName(string storageAccount, string domain, IEnumerable <string> blobs) { try { return(blobs.Select(x => StoredBlobInterfaces.ContainsKey(x) ? StoredBlobInterfaces[x] : (StoredBlobInterfaces[x] = new BlobInterface(storageAccount, domain, x)))); } catch { Trace.WriteLine("FAILED TO GET REQUESTED BLOB INTERFACES: StorageAccount[" + storageAccount + "] Domain[" + domain + "] Blobs[" + string.Join(",", blobs) + "]"); } return(null); }
public static IEnumerable<BlobInterface> GetBlobInterfacesByName(string storageAccount, string domain, IEnumerable<string> blobs) { try { return blobs.Select(x => StoredBlobInterfaces.ContainsKey(x) ? StoredBlobInterfaces[x] : (StoredBlobInterfaces[x] = new BlobInterface(storageAccount, domain, x))); } catch { Trace.WriteLine("FAILED TO GET REQUESTED BLOB INTERFACES: StorageAccount[" + storageAccount + "] Domain[" + domain + "] Blobs[" + string.Join(",", blobs) + "]"); } return null; }