Class FileCache
Namespace: Aurigma.DesignAtoms.Storage.FileCache
Assembly: Aurigma.DesignAtoms.dll
Syntax
public class FileCache : IDisposable
Inheritance: System.Object -> FileCache
Implements
Aurigma.DesignAtoms.Cache.Abstractions.Interfaces.IFileCacheAurigma.DesignAtoms.Cache.Abstractions.Interfaces.ISerializableStorageSystem.IDisposable
Inherited Members
System.Object.ToStringSystem.Object.Equals(System.Object)System.Object.Equals(System.Object,System.Object)System.Object.ReferenceEquals(System.Object,System.Object)System.Object.GetHashCodeSystem.Object.GetTypeSystem.Object.MemberwiseClone
Constructors
FileCache
public FileCache(IConfiguration configuration, IFileStorage fileStorage, IMemoryCachingService memoryCachingService, IFileRepairer fileRepairer)
Methods
Dispose
public void Dispose()
AddFile
public string AddFile(string filePath, bool isSource = false)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | filePath | |
System.Boolean | isSource |
Returns
System.String
AddFileWithId
public void AddFileWithId(string fileId, string filePath, bool isSource = false)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId | |
System.String | filePath | |
System.Boolean | isSource |
AddFile
public string AddFile(string extension, Stream fileData, bool isSource = false)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | extension | |
System.IO.Stream | fileData | |
System.Boolean | isSource |
Returns
System.String
AddFileWithId
public void AddFileWithId(string fileId, Stream fileData, bool isSource = false)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId | |
System.IO.Stream | fileData | |
System.Boolean | isSource |
RemoveFilesWithPrefix
public void RemoveFilesWithPrefix(string prefix)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | prefix |
WriteToStream
public void WriteToStream(string fileId, Action<Stream> action, bool isSource = false)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId | |
System.Action<System.IO.Stream> | action | |
System.Boolean | isSource |
GetReadStream
public Stream GetReadStream(string fileId, bool isSource = false)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId | |
System.Boolean | isSource |
Returns
System.IO.Stream
RemoveFile
public bool RemoveFile(string fileId)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId |
Returns
System.Boolean
FileExists
public bool FileExists(string fileId)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId |
Returns
System.Boolean
UpdateLastAccessTime
public void UpdateLastAccessTime(string fileId)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId |
GetInfo
public CacheFileInfo GetInfo(string fileId)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId |
Returns
Aurigma.DesignAtoms.Cache.Abstractions.Models.CacheFileInfo