ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Properties | List of all members
ImageResizer.Plugins.AzureReader2.AzureVirtualPathProvider Class Reference
Inheritance diagram for ImageResizer.Plugins.AzureReader2.AzureVirtualPathProvider:
Inheritance graph
[legend]
Collaboration diagram for ImageResizer.Plugins.AzureReader2.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 13 of file AzureVirtualPathProvider.cs.

Member Function Documentation

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

Internal usage only

Parameters
virtualPath
Returns

Definition at line 74 of file AzureVirtualPathProvider.cs.

74  {
75  if (FileExists(virtualPath, null))
76  return true;
77  else {
78  return Previous.FileExists(virtualPath);
79  }
80  }
override bool FileExists(string virtualPath)
Internal usage only
bool ImageResizer.Plugins.AzureReader2.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 98 of file AzureVirtualPathProvider.cs.

98  {
99  if (IsPathVirtual(virtualPath)) {
100  if (LazyExistenceCheck) return true;
101 
102  // Strip prefix from virtual path; keep container and blob
103  // mb:12/8/2012 - need to prepend the blob client base uri to the url
104  string relativeBlobURL = string.Format("{0}/{1}",CloudBlobClient.BaseUri.OriginalString.TrimEnd('/', '\\'), virtualPath.Substring(VirtualFilesystemPrefix.Length).Trim('/', '\\'));
105 
106  // Get a reference to the blob
107  // mb:12/8/2012 - this call now must be a uri
108  ICloudBlob cloudBlob = CloudBlobClient.GetBlobReferenceFromServer(new Uri(relativeBlobURL));
109 
110  try {
111  cloudBlob.FetchAttributes();
112  return true;
113  } catch (StorageException e) {
114  if (e.RequestInformation.HttpStatusCode == 404) {
115  return false;
116  } else {
117  throw;
118  }
119  }
120  }
121  return false;
122  }
string VirtualFilesystemPrefix
Requests starting with this path will be handled by this virtual path provider. Can be in app-relativ...
bool IsPathVirtual(string virtualPath)
Determines whether a specified virtual path is within the virtual file system.
override VirtualFile ImageResizer.Plugins.AzureReader2.AzureVirtualPathProvider.GetFile ( string  virtualPath)
inline

For internal use only

Parameters
virtualPath
Returns

Definition at line 87 of file AzureVirtualPathProvider.cs.

87  {
88  VirtualFile vf = (VirtualFile)GetFile(virtualPath, null);
89  return (vf == null) ? Previous.GetFile(virtualPath) : vf;
90  }
override VirtualFile GetFile(string virtualPath)
For internal use only
bool ImageResizer.Plugins.AzureReader2.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 66 of file AzureVirtualPathProvider.cs.

66  {
67  return (virtualPath.StartsWith(VirtualFilesystemPrefix, StringComparison.OrdinalIgnoreCase));
68  }
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.AzureReader2.AzureVirtualPathProvider.LazyExistenceCheck
getset

If true,

Definition at line 37 of file AzureVirtualPathProvider.cs.

string ImageResizer.Plugins.AzureReader2.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 22 of file AzureVirtualPathProvider.cs.


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