Class FileSystemStorageProvider
Provides a storage of small text files as plain files.
public class FileSystemStorageProvider : IStorageProvider
- Inheritance
-
FileSystemStorageProvider
- Implements
- Inherited Members
Methods
Delete(string)
Deletes a file; a missing one is passed over.
public void Delete(string filePath)
Parameters
filePathstringThe file's full path.
GetSignature(string)
Gets a signature of a file, read without its content, which changes when the file is written as a rule: a write that keeps what the signature reads, such as a file's time and length, shows no change.
public string GetSignature(string filePath)
Parameters
filePathstringThe file's full path.
Returns
- string
The signature.
Remarks
It is the file's last write time and length, or none when there is no such file.
Read(string)
Reads a file's text.
public string? Read(string filePath)
Parameters
filePathstringThe file's full path.
Returns
Write(string, string)
Writes a file's text, whole or not at all: a write the provider cannot keep fails, and the old text stays.
public void Write(string filePath, string content)
Parameters
Remarks
It makes the file's folder when missing, and replaces the file atomically.
Exceptions
- ArgumentException
The path has no folder.