public IStorageBlob GetBlobReferenceFromServer(IStorageBlobContainer parent, string containerName, string blobName) { if (!_items.ContainsKey(containerName)) { throw StorageExceptionFactory.Create(404); } return(_items[containerName].GetBlobReferenceFromServer(this, parent, blobName)); }
public void ReleaseLease(string blobName, string leaseId) { if (!_items.ContainsKey(blobName)) { throw StorageExceptionFactory.Create(404, "BlobNotFound"); } _items[blobName].ReleaseLease(leaseId); }
public BlobAttributes FetchAttributes(string containerName, string blobName) { if (!_items.ContainsKey(containerName)) { throw StorageExceptionFactory.Create(404); } return(_items[containerName].FetchAttributes(blobName)); }
public Stream OpenRead(string containerName, string blobName) { if (!_items.ContainsKey(containerName)) { throw StorageExceptionFactory.Create(404); } return(_items[containerName].OpenRead(blobName)); }
public Stream OpenRead(string blobName) { if (!_items.ContainsKey(blobName)) { throw StorageExceptionFactory.Create(404, "BlobNotFound"); } return(new MemoryStream(_items[blobName].Contents, writable: false)); }
public void AddMessage(string queueName, MutableStorageQueueMessage message) { if (!_items.ContainsKey(queueName)) { throw StorageExceptionFactory.Create(404, "QueueNotFound"); } _items[queueName].AddMessage(message); }
public IList <TableResult> ExecuteBatch(string tableName, IStorageTableBatchOperation batch) { if (!_items.ContainsKey(tableName)) { throw StorageExceptionFactory.Create(404, "TableNotFound"); } return(_items[tableName].ExecuteBatch(batch)); }
public CloudBlobStream OpenWriteBlock(string containerName, string blobName, IDictionary <string, string> metadata) { if (!_items.ContainsKey(containerName)) { throw StorageExceptionFactory.Create(404, "ContainerNotFound"); } return(_items[containerName].OpenWriteBlock(blobName, metadata)); }
public IStorageBlob GetBlobReferenceFromServer(MemoryBlobStore store, IStorageBlobContainer parent, string blobName) { if (!_items.ContainsKey(blobName)) { throw StorageExceptionFactory.Create(404); } Blob blob = _items[blobName]; if (blob.BlobType == StorageBlobType.BlockBlob) { return(new FakeStorageBlockBlob(store, blobName, parent)); } else { return(new FakeStoragePageBlob(store, blobName, parent)); } }
public IStorageBlob GetBlobReferenceFromServer(MemoryBlobStore store, IStorageBlobContainer parent, string blobName) { if (!_items.ContainsKey(blobName)) { throw StorageExceptionFactory.Create(404); } Blob blob = _items[blobName]; switch (blob.BlobType) { case StorageBlobType.BlockBlob: return(new FakeStorageBlockBlob(store, blobName, parent)); case StorageBlobType.PageBlob: return(new FakeStoragePageBlob(store, blobName, parent)); case StorageBlobType.AppendBlob: return(new FakeStorageAppendBlob(store, blobName, parent)); default: throw new InvalidOperationException(string.Format("Type '{0}' is not supported.", blob.BlobType)); } }