Table of Contents

Class FileSystemStorageProvider

Namespace
VpnHood.Net.Toolkit.Storages
Assembly
VpnHood.Net.Toolkit.dll

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

filePath string

The 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

filePath string

The 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

filePath string

The file's full path.

Returns

string

The text, or null when there is no such file.

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

filePath string

The file's full path.

content string

The text.

Remarks

It makes the file's folder when missing, and replaces the file atomically.

Exceptions

ArgumentException

The path has no folder.