예제 #1
0
        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);
        }
예제 #2
0
        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;
        }
예제 #3
0
        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);
        }
예제 #4
0
        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;
        }