Functions exactly like an IIS virtual folder, but doesn't require IIS configuration.
More...
|
| VirtualFolder (string virtualPath, string physicalPath) |
|
| VirtualFolder (string virtualPath, string physicalPath, bool registerAsVpp) |
|
| VirtualFolder (NameValueCollection args) |
|
IPlugin | Install (Config c) |
| Registers the VirtualFolder plugin as a virtual path provider. More...
|
|
bool | Uninstall (Config c) |
| Uninstalls the plugin. Should reverse all changes made during Install More...
|
|
string | VirtualToPhysical (string virtualPath) |
|
string | LocalMapPath (string virtualPath) |
| Converts any virtual path in this folder to a physical path. Returns null if the virtual path is outside the folder. More...
|
|
bool | IsVirtualPath (string virtualPath) |
| Returns true if the specified path is inside this virtual folder More...
|
|
DateTime | GetDateModifiedUtc (string virtualPath) |
| Returns the LastWriteTimeUtc value for the specified virtual file in this folder, or DateTime.MinValue if missing. More...
|
|
bool | FileExists (string virtualPath, NameValueCollection queryString) |
| Returns true if the file exists in this virtual folder, and would not be masking an existing file. Returns false if NoIOPermission is true. More...
|
|
IVirtualFile | GetFile (string virtualPath, NameValueCollection queryString) |
| Unless the path is not within the virtual folder, or IO permissions are missing, will return an IVirtualFile instance for the path. The file may or may not exist. More...
|
|
override bool | FileExists (string virtualPath) |
| For internal use only by the .NET VPP system. More...
|
|
override VirtualFile | GetFile (string virtualPath) |
| For internal use only by the .NET VPP system. More...
|
|
override CacheDependency | GetCacheDependency (string virtualPath, System.Collections.IEnumerable virtualPathDependencies, DateTime utcStart) |
| For internal use only by the .NET VPP system. More...
|
|
IEnumerable< IIssue > | GetIssues () |
|
|
string | normalizeVirtualPath (string path) |
| Converts relative and app-relative paths to domain-relative virtual paths. More...
|
|
string | resolvePhysicalPath (string path) |
| Attempts to convert a phyiscal path into a collapsed rooted physical path. More...
|
|
string | collapsePath (string path) |
| Collapses any .. segments More...
|
|
string | collapseOneLevel (string path) |
|
Stream | getStream (string virtualPath) |
|
|
bool | FailedToRegisterVpp [get] |
| True if the provider attempted to register itself as a VirtualPathProvider and failed due to limited security clearance. False if it did not attempt (say, due to missing IOPermission) , or if it succeeded. More...
|
|
bool | RegisterAsVpp [get, set] |
| If true, the plugin will attempt to register itself as an application-wide VirtualPathProvider instead of a image resizer-specific IVirtualImageProvider. More...
|
|
string | VirtualPath [get, set] |
| The virtual path served by the VirtualFolder More...
|
|
string | PhysicalPath [get, set] |
| The physical path More...
|
|
bool | NoIOPermission [get] |
| True if the plugin has detected it doesn't have sufficient IOPermission to operate. More...
|
|
Functions exactly like an IIS virtual folder, but doesn't require IIS configuration.
Definition at line 22 of file VirtualFolder.cs.
string ImageResizer.Plugins.Basic.VirtualFolder.collapsePath |
( |
string |
path | ) |
|
|
inlineprotected |
Collapses any .. segments
- Parameters
-
- Returns
Definition at line 137 of file VirtualFolder.cs.
138 string oldPath = path;
141 path = collapseOneLevel(oldPath);
142 }
while (oldPath != path);
bool ImageResizer.Plugins.Basic.VirtualFolder.FileExists |
( |
string |
virtualPath, |
|
|
NameValueCollection |
queryString |
|
) |
| |
|
inline |
Returns true if the file exists in this virtual folder, and would not be masking an existing file. Returns false if NoIOPermission is true.
- Parameters
-
- Returns
Implements ImageResizer.Plugins.IVirtualImageProvider.
Definition at line 230 of file VirtualFolder.cs.
bool IsVirtualPath(string virtualPath)
Returns true if the specified path is inside this virtual folder
string LocalMapPath(string virtualPath)
Converts any virtual path in this folder to a physical path. Returns null if the virtual path is outs...
bool NoIOPermission
True if the plugin has detected it doesn't have sufficient IOPermission to operate.
string normalizeVirtualPath(string path)
Converts relative and app-relative paths to domain-relative virtual paths.
override bool ImageResizer.Plugins.Basic.VirtualFolder.FileExists |
( |
string |
virtualPath | ) |
|
|
inline |
For internal use only by the .NET VPP system.
- Parameters
-
- Returns
Definition at line 258 of file VirtualFolder.cs.
259 if (isOnlyVirtualPath(virtualPath))
262 return Previous.FileExists(virtualPath);
string LocalMapPath(string virtualPath)
Converts any virtual path in this folder to a physical path. Returns null if the virtual path is outs...
override CacheDependency ImageResizer.Plugins.Basic.VirtualFolder.GetCacheDependency |
( |
string |
virtualPath, |
|
|
System.Collections.IEnumerable |
virtualPathDependencies, |
|
|
DateTime |
utcStart |
|
) |
| |
|
inline |
For internal use only by the .NET VPP system.
- Parameters
-
virtualPath | |
virtualPathDependencies | |
utcStart | |
- Returns
Definition at line 282 of file VirtualFolder.cs.
287 if (!isOnlyVirtualPath(virtualPath))
return Previous.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart);
289 List<String> deps =
new List<string>();
290 foreach (
string s
in virtualPathDependencies) {
295 return new CacheDependency(
new string[] {
LocalMapPath(virtualPath) }, deps.ToArray(), utcStart);
string LocalMapPath(string virtualPath)
Converts any virtual path in this folder to a physical path. Returns null if the virtual path is outs...
DateTime ImageResizer.Plugins.Basic.VirtualFolder.GetDateModifiedUtc |
( |
string |
virtualPath | ) |
|
|
inline |
Returns the LastWriteTimeUtc value for the specified virtual file in this folder, or DateTime.MinValue if missing.
- Parameters
-
- Returns
Definition at line 216 of file VirtualFolder.cs.
218 if (System.IO.File.Exists(physicalPath))
219 return System.IO.File.GetLastWriteTimeUtc(physicalPath);
220 else return DateTime.MinValue;
string LocalMapPath(string virtualPath)
Converts any virtual path in this folder to a physical path. Returns null if the virtual path is outs...
IVirtualFile ImageResizer.Plugins.Basic.VirtualFolder.GetFile |
( |
string |
virtualPath, |
|
|
NameValueCollection |
queryString |
|
) |
| |
|
inline |
Unless the path is not within the virtual folder, or IO permissions are missing, will return an IVirtualFile instance for the path. The file may or may not exist.
- Parameters
-
- Returns
Implements ImageResizer.Plugins.IVirtualImageProvider.
Definition at line 247 of file VirtualFolder.cs.
250 return new VirtualFolderProviderVirtualFile(virtualPath,
this);
bool IsVirtualPath(string virtualPath)
Returns true if the specified path is inside this virtual folder
bool NoIOPermission
True if the plugin has detected it doesn't have sufficient IOPermission to operate.
override VirtualFile ImageResizer.Plugins.Basic.VirtualFolder.GetFile |
( |
string |
virtualPath | ) |
|
|
inline |
For internal use only by the .NET VPP system.
- Parameters
-
- Returns
Definition at line 269 of file VirtualFolder.cs.
270 if (isOnlyVirtualPath(virtualPath))
271 return new VirtualFolderProviderVirtualFile(virtualPath,
this);
273 return Previous.GetFile(virtualPath);
IPlugin ImageResizer.Plugins.Basic.VirtualFolder.Install |
( |
Config |
c | ) |
|
|
inline |
Registers the VirtualFolder plugin as a virtual path provider.
- Returns
Implements ImageResizer.Plugins.IPlugin.
Definition at line 81 of file VirtualFolder.cs.
84 HostingEnvironment.RegisterVirtualPathProvider(
this);
86 }
catch (SecurityException) {
87 this._failedToRegisterVpp =
true;
90 c.Plugins.add_plugin(
this);
bool RegisterAsVpp
If true, the plugin will attempt to register itself as an application-wide VirtualPathProvider instea...
bool NoIOPermission
True if the plugin has detected it doesn't have sufficient IOPermission to operate.
bool ImageResizer.Plugins.Basic.VirtualFolder.IsVirtualPath |
( |
string |
virtualPath | ) |
|
|
inline |
Returns true if the specified path is inside this virtual folder
- Parameters
-
- Returns
Definition at line 186 of file VirtualFolder.cs.
188 return virtualPath.StartsWith(this.VirtualPath, StringComparison.OrdinalIgnoreCase);
string normalizeVirtualPath(string path)
Converts relative and app-relative paths to domain-relative virtual paths.
string ImageResizer.Plugins.Basic.VirtualFolder.LocalMapPath |
( |
string |
virtualPath | ) |
|
|
inline |
Converts any virtual path in this folder to a physical path. Returns null if the virtual path is outside the folder.
- Parameters
-
- Returns
Definition at line 174 of file VirtualFolder.cs.
176 if (virtualPath.StartsWith(
this.VirtualPath, StringComparison.OrdinalIgnoreCase)) {
177 return Path.Combine(
PhysicalPath, virtualPath.Substring(this.VirtualPath.Length).TrimStart(
'/').Replace(
'/', Path.DirectorySeparatorChar));
string PhysicalPath
The physical path
string normalizeVirtualPath(string path)
Converts relative and app-relative paths to domain-relative virtual paths.
string ImageResizer.Plugins.Basic.VirtualFolder.normalizeVirtualPath |
( |
string |
path | ) |
|
|
inlineprotected |
Converts relative and app-relative paths to domain-relative virtual paths.
- Parameters
-
- Returns
Definition at line 111 of file VirtualFolder.cs.
112 if (!path.StartsWith(
"/")) path = HostingEnvironment.ApplicationVirtualPath.TrimEnd(
'/') +
'/' + (path.StartsWith(
"~") ? path.Substring(1) : path).TrimStart(
'/');
string ImageResizer.Plugins.Basic.VirtualFolder.resolvePhysicalPath |
( |
string |
path | ) |
|
|
inlineprotected |
Attempts to convert a phyiscal path into a collapsed rooted physical path.
- Parameters
-
- Returns
Definition at line 120 of file VirtualFolder.cs.
122 if (!Path.IsPathRooted(path)) path = Path.Combine(HostingEnvironment.ApplicationPhysicalPath, path);
126 return Path.GetFullPath(path);
127 }
catch (SecurityException) {
128 noIOPermission =
true;
bool NoIOPermission
True if the plugin has detected it doesn't have sufficient IOPermission to operate.
string collapsePath(string path)
Collapses any .. segments
bool ImageResizer.Plugins.Basic.VirtualFolder.Uninstall |
( |
Config |
c | ) |
|
|
inline |
Uninstalls the plugin. Should reverse all changes made during Install
- Parameters
-
- Returns
Implements ImageResizer.Plugins.IPlugin.
Definition at line 93 of file VirtualFolder.cs.
94 c.Plugins.remove_plugin(
this);
95 return !registeredVpp;
bool ImageResizer.Plugins.Basic.VirtualFolder.FailedToRegisterVpp |
|
get |
True if the provider attempted to register itself as a VirtualPathProvider and failed due to limited security clearance. False if it did not attempt (say, due to missing IOPermission) , or if it succeeded.
Definition at line 48 of file VirtualFolder.cs.
bool ImageResizer.Plugins.Basic.VirtualFolder.NoIOPermission |
|
get |
True if the plugin has detected it doesn't have sufficient IOPermission to operate.
Definition at line 102 of file VirtualFolder.cs.
string ImageResizer.Plugins.Basic.VirtualFolder.PhysicalPath |
|
getset |
bool ImageResizer.Plugins.Basic.VirtualFolder.RegisterAsVpp |
|
getset |
If true, the plugin will attempt to register itself as an application-wide VirtualPathProvider instead of a image resizer-specific IVirtualImageProvider.
Definition at line 55 of file VirtualFolder.cs.
string ImageResizer.Plugins.Basic.VirtualFolder.VirtualPath |
|
getset |
The documentation for this class was generated from the following file: