|
IVirtualFile | GetFileIfCached (string virtualPath, System.Collections.Specialized.NameValueCollection queryString, IVirtualFile original) |
|
IPlugin | Install (Config c) |
| Loads the settings from 'c', starts the cache, and registers the plugin. Will throw an invalidoperationexception if already started. More...
|
|
bool | Uninstall (Config c) |
| Uninstalls the plugin. Should reverse all changes made during Install More...
|
|
bool | IsConfigurationValid () |
| Returns true if the configured settings are valid and .NET (not NTFS) permissions will work. More...
|
|
bool | Start () |
| Attempts to start the DiskCache using the current settings. Returns true if succesful or if already started. Returns false on a configuration error. Called by Install() More...
|
|
bool | Stop () |
| Returns true if stopped succesfully. Cannot be restarted More...
|
|
IVirtualFile | GetFileIfCached (string virtualPath, NameValueCollection queryString, IVirtualFile original) |
| Returns a cached copy of virtual file if it is cached, and if caching is desired. More...
|
|
|
string | virtualDir = HostingEnvironment.ApplicationVirtualPath.TrimEnd('/') + "/cache/sourceimages" |
|
CustomDiskCache | cache = null |
|
CleanupManager | cleaner = null |
|
WebConfigWriter | writer = null |
|
readonly object | _startSync = new object() |
|
volatile bool | _started = false |
|
ILogger | log = null |
|
|
string | VirtualCacheDir [get, set] |
| Sets the location of the cache directory. Can be a virtual path (like /App/imagecache) or an application-relative path (like ~/imagecache, the default). Relative paths are assummed to be relative to the application root. All values are converted to virtual path format upon assignment (/App/imagecache) Will throw an InvalidOperationException if changed after the plugin is installed. More...
|
|
string | PhysicalCacheDir [get] |
| Returns the physical path of the cache directory specified in VirtualCacheDir. More...
|
|
bool | Started [get] |
| Returns true if the DiskCache instance is operational. More...
|
|
ILogger | Logger [get] |
|
ILogger | Logger [get] |
|
Definition at line 17 of file SourceDiskCache.cs.
void ImageResizer.Plugins.SourceDiskCache.SourceDiskCachePlugin.BeforeSettingChanged |
( |
| ) |
|
|
inlineprotected |
Throws an exception if the class is already modified
Definition at line 57 of file SourceDiskCache.cs.
59 if (_started)
throw new InvalidOperationException(
"SourceDiskCache settings may not be adjusted after it is started.");
bool ImageResizer.Plugins.SourceDiskCache.SourceDiskCachePlugin.HasFileIOPermission |
( |
| ) |
|
|
inlineprotected |
Returns true if .NET permissions allow writing to the cache directory. Does not check NTFS permissions.
- Returns
Definition at line 176 of file SourceDiskCache.cs.
177 FileIOPermission writePermission =
new FileIOPermission(FileIOPermissionAccess.AllAccess,
new string[]{
PhysicalCacheDir, Path.Combine(PhysicalCacheDir,
"web.config")});
178 return SecurityManager.IsGranted(writePermission);
string PhysicalCacheDir
Returns the physical path of the cache directory specified in VirtualCacheDir.
IPlugin ImageResizer.Plugins.SourceDiskCache.SourceDiskCachePlugin.Install |
( |
Config |
c | ) |
|
|
inline |
Loads the settings from 'c', starts the cache, and registers the plugin. Will throw an invalidoperationexception if already started.
- Parameters
-
- Returns
Implements ImageResizer.Plugins.IPlugin.
Definition at line 134 of file SourceDiskCache.cs.
135 if (c.get(
"diskcache.logging",
false)) {
137 log = c.Plugins.LogManager.GetLogger(
"ImageResizer.Plugins.DiskCache");
139 c.Plugins.LoggingAvailable += delegate(
ILogManager mgr) {
140 if (log != null) log = c.Plugins.LogManager.GetLogger(
"ImageResizer.Plugins.DiskCache");
145 c.Pipeline.AuthorizeImage += Pipeline_AuthorizeImage;
146 c.Plugins.add_plugin(
this);
ILogManager LogManager
Returns the most recently registered Logging plugin, or null.
PluginConfig Plugins
Access and modify plugins
bool Start()
Attempts to start the DiskCache using the current settings. Returns true if succesful or if already s...
bool ImageResizer.Plugins.SourceDiskCache.SourceDiskCachePlugin.IsConfigurationValid |
( |
| ) |
|
|
inline |
Returns true if the configured settings are valid and .NET (not NTFS) permissions will work.
- Returns
Definition at line 167 of file SourceDiskCache.cs.
string VirtualCacheDir
Sets the location of the cache directory. Can be a virtual path (like /App/imagecache) or an applicat...
bool HasFileIOPermission()
Returns true if .NET permissions allow writing to the cache directory. Does not check NTFS permission...
bool ImageResizer.Plugins.SourceDiskCache.SourceDiskCachePlugin.Start |
( |
| ) |
|
|
inline |
Attempts to start the DiskCache using the current settings. Returns true if succesful or if already started. Returns false on a configuration error. Called by Install()
Definition at line 186 of file SourceDiskCache.cs.
191 if (_started)
return true;
200 cleanupStrategy.TargetItemsPerFolder = 50;
205 if (cleaner != null) cleaner.CleanAll();
string PhysicalCacheDir
Returns the physical path of the cache directory specified in VirtualCacheDir.
Handles writing a Web.Config to disk that uses Url Authorization to prevent visitors from accessing t...
bool IsConfigurationValid()
Returns true if the configured settings are valid and .NET (not NTFS) permissions will work...
Handles access to a disk-based file cache. Handles locking and versioning. Supports subfolders for sc...
bool ImageResizer.Plugins.SourceDiskCache.SourceDiskCachePlugin.Stop |
( |
| ) |
|
|
inline |
Returns true if stopped succesfully. Cannot be restarted
- Returns
Definition at line 216 of file SourceDiskCache.cs.
218 if (cleaner != null) cleaner.Dispose();
bool ImageResizer.Plugins.SourceDiskCache.SourceDiskCachePlugin.Uninstall |
( |
Config |
c | ) |
|
|
inline |
Uninstalls the plugin. Should reverse all changes made during Install
- Parameters
-
- Returns
Implements ImageResizer.Plugins.IPlugin.
Definition at line 156 of file SourceDiskCache.cs.
158 c.Plugins.remove_plugin(
this);
159 c.Pipeline.AuthorizeImage -= Pipeline_AuthorizeImage;
string ImageResizer.Plugins.SourceDiskCache.SourceDiskCachePlugin.PhysicalCacheDir |
|
get |
Returns the physical path of the cache directory specified in VirtualCacheDir.
Definition at line 47 of file SourceDiskCache.cs.
bool ImageResizer.Plugins.SourceDiskCache.SourceDiskCachePlugin.Started |
|
get |
string ImageResizer.Plugins.SourceDiskCache.SourceDiskCachePlugin.VirtualCacheDir |
|
getset |
Sets the location of the cache directory. Can be a virtual path (like /App/imagecache) or an application-relative path (like ~/imagecache, the default). Relative paths are assummed to be relative to the application root. All values are converted to virtual path format upon assignment (/App/imagecache) Will throw an InvalidOperationException if changed after the plugin is installed.
Definition at line 30 of file SourceDiskCache.cs.
The documentation for this class was generated from the following file: