ImageResizer
3.4.0
|
Represents a cached view of a folder of cached items More...
Public Member Functions | |
virtual void | clear () |
virtual CachedFileInfo | getCachedFileInfo (string relativePath) |
Returns null if (a) the file doesn't exist, or (b) the file isn't populated. Calling code should always fall back to filesystem calls on a null result. More... | |
virtual void | setCachedFileInfo (string relativePath, CachedFileInfo info) |
Sets the CachedFileInfo object for the specified path, creating any needed folders along the way. If 'null', the item will be removed, and no missing folder will be created. More... | |
bool | bumpDateIfExists (string relativePath) |
Tries to set the AccessedUtc of the specified file to the current date (just in memory, not on the filesystem). More... | |
virtual CachedFileInfo | getFileInfo (string relativePath, string physicalPath) |
Gets a CachedFileInfo object for the file even if it isn't in the cache (falls back to the filesystem) More... | |
virtual CachedFileInfo | getFileInfoCertainExists (string relativePath, string physicalPath) |
Verifies the file exists before returning the cached data. Discrepancies in file existence result in OnFileDisappeard being fired. More... | |
bool | GetIsValid (string relativePath) |
Returns the value of IsValid on the specified folder if present, or 'false' if not present. More... | |
IList< string > | getSubfolders (string relativePath) |
returns a list More... | |
Dictionary< string, CachedFileInfo > | getSubfilesCopy (string relativePath) |
returns a dictionary of files. More... | |
ICollection< KeyValuePair < string, CachedFileInfo > > | getSortedSubfiles (string relativePath) |
returns a dictionary of files. More... | |
int | getFileCount (string relativePath) |
void | populate (string relativePath, string physicalPath) |
Refreshes file and folder listing for this folder (non-recursive). Sets IsValid=true afterwards. More... | |
bool | existsCertain (string relativePath, string physicalPath) |
bool | exists (string relativePath, string physicalPath) |
bool | modifiedDateMatches (DateTime utc, string relativePath, string physicalPath) |
bool | modifiedDateMatchesCertainExists (DateTime utc, string relativePath, string physicalPath) |
Protected Member Functions | |
CachedFolder | getFolder (string relativePath) |
Not thread safe. More... | |
CachedFolder | getOrCreateFolder (string relativePath, bool createIfMissing) |
void | populateSubfolders (string relativePath, string physicalPath) |
Updates the 'folders' dictionary to match the folders that exist on disk. ONLY UPDATES THE LOCAL FOLDER More... | |
void | populateFiles (string relativePath, string physicalPath) |
Updates the 'files' dictionary to match the files that exist on disk. Uses the accessedUtc values from the previous dictionary if they are newer. More... | |
bool | roughCompare (DateTime d1, DateTime d2) |
Returns true if both dates are equal to the nearest 200th of a second. More... | |
string | checkRelativePath (string relativePath) |
Protected Attributes | |
readonly object | _sync = new object() |
Dictionary< string, CachedFolder > | folders = new Dictionary<string, CachedFolder>(StringComparer.OrdinalIgnoreCase) |
Dictionary< string, CachedFileInfo > | files = new Dictionary<string, CachedFileInfo>(StringComparer.OrdinalIgnoreCase) |
Properties | |
bool | IsValid [get, set] |
Defaults to false. Set to true immediately after being refreshed from the filesystem. Set to false if a file disappears from the filesystem cache without the cache index being notified first. Used by the cleanup system - not of importance to the cache write system. More... | |
StringComparer | KeyComparer [get] |
Events | |
FileDisappearedHandler | FileDisappeared |
Fired when a file disappears from the cache folder without the cache index knowing about it. More... | |
Represents a cached view of a folder of cached items
Definition at line 14 of file CachedFolder.cs.
|
inline |
Tries to set the AccessedUtc of the specified file to the current date (just in memory, not on the filesystem).
relativePath |
Definition at line 114 of file CachedFolder.cs.
|
inlineprotected |
|
inlinevirtual |
Returns null if (a) the file doesn't exist, or (b) the file isn't populated. Calling code should always fall back to filesystem calls on a null result.
relativePath |
Definition at line 59 of file CachedFolder.cs.
|
inlinevirtual |
Gets a CachedFileInfo object for the file even if it isn't in the cache (falls back to the filesystem)
relativePath | |
physicalPath |
Definition at line 142 of file CachedFolder.cs.
|
inlinevirtual |
Verifies the file exists before returning the cached data. Discrepancies in file existence result in OnFileDisappeard being fired.
relativePath | |
physicalPath |
Definition at line 163 of file CachedFolder.cs.
|
inlineprotected |
|
inline |
Returns the value of IsValid on the specified folder if present, or 'false' if not present.
relativePath |
Definition at line 196 of file CachedFolder.cs.
|
inline |
returns a dictionary of files.
relativePath |
Definition at line 262 of file CachedFolder.cs.
|
inline |
returns a dictionary of files.
relativePath |
Definition at line 251 of file CachedFolder.cs.
|
inline |
returns a list
relativePath |
Definition at line 239 of file CachedFolder.cs.
|
inline |
Refreshes file and folder listing for this folder (non-recursive). Sets IsValid=true afterwards.
relativePath | |
physicalPath |
Definition at line 296 of file CachedFolder.cs.
|
inlineprotected |
Updates the 'files' dictionary to match the files that exist on disk. Uses the accessedUtc values from the previous dictionary if they are newer.
relativePath | |
physicalPath |
Definition at line 335 of file CachedFolder.cs.
|
inlineprotected |
Updates the 'folders' dictionary to match the folders that exist on disk. ONLY UPDATES THE LOCAL FOLDER
relativePath | |
physicalPath |
Definition at line 308 of file CachedFolder.cs.
|
inlineprotected |
Returns true if both dates are equal to the nearest 200th of a second.
d1 | |
d2 |
Definition at line 390 of file CachedFolder.cs.
|
inlinevirtual |
Sets the CachedFileInfo object for the specified path, creating any needed folders along the way. If 'null', the item will be removed, and no missing folder will be created.
relativePath | |
info |
Definition at line 84 of file CachedFolder.cs.
|
getset |
Defaults to false. Set to true immediately after being refreshed from the filesystem. Set to false if a file disappears from the filesystem cache without the cache index being notified first. Used by the cleanup system - not of importance to the cache write system.
Definition at line 25 of file CachedFolder.cs.
FileDisappearedHandler ImageResizer.Plugins.DiskCache.CachedFolder.FileDisappeared |
Fired when a file disappears from the cache folder without the cache index knowing about it.
Definition at line 36 of file CachedFolder.cs.