public BlobAttributes FetchAttributes(string containerName, string blobName) { if (!_items.ContainsKey(containerName)) { throw StorageExceptionFactory.Create(404); } return(_items[containerName].FetchAttributes(blobName)); }
public ICloudBlob GetBlobReferenceFromServer(CloudBlobContainer 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 Stream OpenRead(string blobName) { if (!_items.ContainsKey(blobName)) { throw StorageExceptionFactory.Create(404, "BlobNotFound"); } return(new MemoryStream(_items[blobName].Contents, writable: false)); }
public Stream OpenRead(string containerName, string blobName) { if (!_items.ContainsKey(containerName)) { throw StorageExceptionFactory.Create(404); } return(_items[containerName].OpenRead(blobName)); }
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 ICloudBlob GetBlobReferenceFromServer(MemoryBlobStore store, CloudBlobContainer 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)); } }