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 |
---|---|
Single |
FileCount
The number of files which are currently stored in the cache
Declaration
int FileCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
SessionPersistence
If true, cached files should be stored between app sessions
Declaration
bool SessionPersistence { get; }
Property Value
Type | Description |
---|---|
Boolean |
UseSafeMode
If true, cached files are protected against switching them
Declaration
bool UseSafeMode { get; }
Property Value
Type | Description |
---|---|
Boolean |
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 |
---|---|
Boolean | Returns true if the file is cached, otherwise false |