Class FileStorage
Namespace: Aurigma.DesignAtoms.Storage.FileStorage
Assembly: Aurigma.DesignAtoms.dll
Syntax
public class FileStorage : IProtectableFileStorage, IFileStorage, IDisposable
Inheritance: System.Object -> FileStorage
Implements
- Aurigma.DesignAtoms.Storage.FileStorage.IProtectableFileStorage
- Aurigma.DesignAtoms.Storage.FileStorage.IFileStorage
System.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
FileStorage
public FileStorage(IFileCacheConfiguration fileCacheConfig, bool initializeCleanup = true)
Properties
GetLastAccessTimeMethod
public Func<string, DateTime?> GetLastAccessTimeMethod { get; set; }
Methods
InitializePeriodicCleanUp
public void InitializePeriodicCleanUp()
Finalize
protected void Finalize()
Dispose
public void Dispose()
AddFile
public string AddFile(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | filePath |
Returns
System.String
AddFileWithId
public void AddFileWithId(string fileId, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId | |
System.String | filePath |
AddFile
public string AddFile(string extension, Stream fileData)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | extension | |
System.IO.Stream | fileData |
Returns
System.String
AddFileWithId
public void AddFileWithId(string fileId, Stream fileData)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId | |
System.IO.Stream | fileData |
WriteToStream
public void WriteToStream(string fileId, Action<Stream> action)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId | |
System.Action<System.IO.Stream> | action |
GetReadStream
public Stream GetReadStream(string fileId)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId |
Returns
System.IO.Stream
GetInfo
public CacheFileInfo GetInfo(string fileId)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId |
Returns
Aurigma.DesignAtoms.Cache.Abstractions.Models.CacheFileInfo
RemoveFile
public bool RemoveFile(string fileId)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId |
Returns
System.Boolean
RemoveFilesByPrefix
public IEnumerable<string> RemoveFilesByPrefix(string prefix)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | prefix |
Returns
System.Collections.Generic.IEnumerable<System.String>
UpdateLastAccessTime
public void UpdateLastAccessTime(string fileId)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId |
FileExists
public bool FileExists(string fileId)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId |
Returns
System.Boolean
SetProtection
public virtual void SetProtection(string fileId, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId | |
System.Boolean | value |
IsProtected
public virtual bool IsProtected(string fileId)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileId |
Returns
System.Boolean