ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Properties | List of all members
ImageResizer.Plugins.AzureReader.AzureVirtualPathProvider Class Reference
Inheritance diagram for ImageResizer.Plugins.AzureReader.AzureVirtualPathProvider:
Inheritance graph
[legend]
Collaboration diagram for ImageResizer.Plugins.AzureReader.AzureVirtualPathProvider:
Collaboration graph
[legend]

Public Member Functions

 AzureVirtualPathProvider (string blobStorageConnection)
 
bool IsPathVirtual (string virtualPath)
 Determines whether a specified virtual path is within the virtual file system. More...
 
override bool FileExists (string virtualPath)
 Internal usage only More...
 
override VirtualFile GetFile (string virtualPath)
 For internal use only More...
 
bool FileExists (string virtualPath, System.Collections.Specialized.NameValueCollection queryString)
 Returns true if the specified file is within the azure virtual directory prefix, and if it exists. Returns true even if the file doesn't exist when LazyExistenceCheck=true More...
 
IVirtualFile GetFile (string virtualPath, System.Collections.Specialized.NameValueCollection queryString)
 
- Public Member Functions inherited from ImageResizer.Plugins.IVirtualImageProvider
bool FileExists (string virtualPath, NameValueCollection queryString)
 Returns true if the specified file exists. More...
 
IVirtualFile GetFile (string virtualPath, NameValueCollection queryString)
 Returns a virtual file instance for the specified path and querystring. More...
 

Properties

string VirtualFilesystemPrefix [get, set]
 Requests starting with this path will be handled by this virtual path provider. Can be in app-relative form: "~/azure/". Will be translated to domain-relative form. More...
 
bool LazyExistenceCheck [get, set]
 If true, More...
 
CloudBlobClient CloudBlobClient [get, set]
 

Detailed Description

Definition at line 12 of file AzureVirtualPathProvider.cs.

Member Function Documentation

override bool ImageResizer.Plugins.AzureReader.AzureVirtualPathProvider.FileExists ( string  virtualPath)
inline

Internal usage only

Parameters
virtualPath
Returns

Definition at line 72 of file AzureVirtualPathProvider.cs.

72  {
73  if (FileExists(virtualPath, null))
74  return true;
75  else {
76  return Previous.FileExists(virtualPath);
77  }
78  }
override bool FileExists(string virtualPath)
Internal usage only
bool ImageResizer.Plugins.AzureReader.AzureVirtualPathProvider.FileExists ( string  virtualPath,
System.Collections.Specialized.NameValueCollection  queryString 
)
inline

Returns true if the specified file is within the azure virtual directory prefix, and if it exists. Returns true even if the file doesn't exist when LazyExistenceCheck=true

Parameters
virtualPath
queryString
Returns

Definition at line 96 of file AzureVirtualPathProvider.cs.

96  {
97  if (IsPathVirtual(virtualPath)) {
98  if (LazyExistenceCheck) return true;
99 
100  // Strip prefix from virtual path; keep container and blob
101  string relativeBlobURL = virtualPath.Substring(VirtualFilesystemPrefix.Length).Trim('/', '\\');
102 
103  // Get a reference to the blob
104  CloudBlob cloudBlob = CloudBlobClient.GetBlobReference(relativeBlobURL);
105 
106  try {
107  cloudBlob.FetchAttributes();
108  return true;
109  } catch (StorageClientException e) {
110  if (e.ErrorCode == StorageErrorCode.ResourceNotFound) {
111  return false;
112  } else {
113  throw;
114  }
115  }
116  }
117  return false;
118  }
bool IsPathVirtual(string virtualPath)
Determines whether a specified virtual path is within the virtual file system.
override VirtualFile ImageResizer.Plugins.AzureReader.AzureVirtualPathProvider.GetFile ( string  virtualPath)
inline

For internal use only

Parameters
virtualPath
Returns

Definition at line 85 of file AzureVirtualPathProvider.cs.

85  {
86  VirtualFile vf = (VirtualFile)GetFile(virtualPath, null);
87  return (vf == null) ? Previous.GetFile(virtualPath) : vf;
88  }
override VirtualFile GetFile(string virtualPath)
For internal use only
bool ImageResizer.Plugins.AzureReader.AzureVirtualPathProvider.IsPathVirtual ( string  virtualPath)
inline

Determines whether a specified virtual path is within the virtual file system.

Parameters
virtualPathAn absolute virtual path.
Returns
True if the virtual path is within the virtual file sytem; otherwise, false.

Definition at line 64 of file AzureVirtualPathProvider.cs.

64  {
65  return (virtualPath.StartsWith(VirtualFilesystemPrefix, StringComparison.OrdinalIgnoreCase));
66  }
string VirtualFilesystemPrefix
Requests starting with this path will be handled by this virtual path provider. Can be in app-relativ...

Property Documentation

bool ImageResizer.Plugins.AzureReader.AzureVirtualPathProvider.LazyExistenceCheck
getset

If true,

Definition at line 36 of file AzureVirtualPathProvider.cs.

string ImageResizer.Plugins.AzureReader.AzureVirtualPathProvider.VirtualFilesystemPrefix
getset

Requests starting with this path will be handled by this virtual path provider. Can be in app-relative form: "~/azure/". Will be translated to domain-relative form.

Definition at line 21 of file AzureVirtualPathProvider.cs.


The documentation for this class was generated from the following file: