public ICloudBlob GetBlobReferenceFromServer(MemoryBlobStore store, FakeStorageBlobContainer parent, string blobName) { if (!_items.ContainsKey(blobName)) { throw StorageExceptionFactory.Create(404); } Blob blob = _items[blobName]; if (blob._hook != null) { return(blob._hook); } FakeStorageBlobProperties properties = new FakeStorageBlobProperties() { ETag = blob.ETag, LastModified = blob.LastModified, }; switch (blob.BlobType) { case BlobType.BlockBlob: return(new FakeStorageBlockBlob(blobName, parent, properties)); case BlobType.PageBlob: return(new FakeStoragePageBlob(blobName, parent, properties)); case BlobType.AppendBlob: return(new FakeStorageAppendBlob(blobName, parent, properties)); default: throw new InvalidOperationException(string.Format("Type '{0}' is not supported.", blob.BlobType)); } }
public ICloudBlob GetBlobReferenceFromServer(FakeStorageBlobContainer parent, string containerName, string blobName) { if (!_items.ContainsKey(containerName)) { throw StorageExceptionFactory.Create(404); } return(_items[containerName].GetBlobReferenceFromServer(this, parent, blobName)); }
public BlobAttributes FetchAttributes(string containerName, string blobName) { if (!_items.ContainsKey(containerName)) { throw StorageExceptionFactory.Create(404); } return(_items[containerName].FetchAttributes(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 void AddMessage(string queueName, CloudQueueMessage message) { if (!_items.ContainsKey(queueName)) { throw StorageExceptionFactory.Create(404, "QueueNotFound"); } _items[queueName].AddMessage(message); }
public IList <TableResult> ExecuteBatch(string tableName, TableBatchOperation 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)); }