Interface IFileCache
A file cache for storing local copies for remote files
Namespace: i5.Toolkit.Core.Caching
Assembly: cs.temp.dll.dll
Syntax
public interface IFileCache
Properties
CacheLocation
States where the cache is stored on the file system
Declaration
string CacheLocation { get; }
Property Value
Type | Description |
---|---|
string |
DaysValid
States how long entries should stay valid before they need to be re-downloaded
Declaration
float DaysValid { get; }
Property Value
Type | Description |
---|---|
float |
FileCount
The number of files which are currently stored in the cache
Declaration
int FileCount { get; }
Property Value
Type | Description |
---|---|
int |
SessionPersistence
If true, cached files should be stored between app sessions
Declaration
bool SessionPersistence { get; }
Property Value
Type | Description |
---|---|
bool |
UseSafeMode
If true, cached files are protected against switching them
Declaration
bool UseSafeMode { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
AddOrUpdateInCacheAsync(string)
Adds a new entry to the cache or forces an update to an existing entry
Declaration
Task<string> AddOrUpdateInCacheAsync(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the remote file, probably an URL |
Returns
Type | Description |
---|---|
Task<><string> | Returns the file path of the cached file on the local file system |
GetCachedFileLocation(string)
Looks up the path to the cached file, given a path to the remote
Declaration
string GetCachedFileLocation(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the remote file, probably an URL |
Returns
Type | Description |
---|---|
string | Retruns the path to the local cached file or an empty string if the file is not cached |
IsFileInCache(string)
Checks whether the file at the given URL path was already cached
Declaration
bool IsFileInCache(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the remote file, probably an URL |
Returns
Type | Description |
---|---|
bool | Returns true if the file is cached, otherwise false |