|
| AzureFile (string blobName, AzureVirtualPathProvider parentProvider) |
|
override System.IO.Stream | Open () |
| Attempts to download the blob into a MemoryStream instance and return it. Throws a FileNotFoundException if the blob doesn't exist. More...
|
|
|
string | VirtualPath [get] |
| The virtual path of the file (relative to the domain, like /app/folder/file.ext) More...
|
|
Definition at line 10 of file AzureFile.cs.
override System.IO.Stream ImageResizer.Plugins.AzureReader.AzureFile.Open |
( |
| ) |
|
|
inline |
Attempts to download the blob into a MemoryStream instance and return it. Throws a FileNotFoundException if the blob doesn't exist.
- Returns
Implements ImageResizer.Plugins.IVirtualFile.
Definition at line 21 of file AzureFile.cs.
25 CloudBlob cloudBlob = parent.CloudBlobClient.GetBlobReference(
VirtualPath);
27 MemoryStream ms =
new MemoryStream(4096);
31 cloudBlob.DownloadToStream(ms);
33 catch (StorageClientException e) {
34 if (e.ErrorCode == StorageErrorCode.ResourceNotFound) {
35 throw new FileNotFoundException(
"Azure blob file not found", e);
37 else if (e.ErrorCode == StorageErrorCode.ContainerNotFound) {
38 throw new FileNotFoundException(
"Azure blob container not found", e);
45 ms.Seek(0, SeekOrigin.Begin);
string VirtualPath
The virtual path of the file (relative to the domain, like /app/folder/file.ext)
The documentation for this class was generated from the following file:
- C:/Users/nathanael/Documents/resizer/Plugins/AzureReader/AzureFile.cs