Table of Contents

Class Storage

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

Provides a folder of small text files that its provider keeps; OpenStorage(string) gives a folder inside it. It takes names, never paths, so whoever holds one stays inside its folder, links on the disk aside.

public sealed class Storage
Inheritance
Storage
Inherited Members
Extension Methods

Constructors

Storage(IStorageProvider, string)

Provides a folder of small text files that its provider keeps; OpenStorage(string) gives a folder inside it. It takes names, never paths, so whoever holds one stays inside its folder, links on the disk aside.

public Storage(IStorageProvider provider, string folderPath)

Parameters

provider IStorageProvider

The provider that keeps the files.

folderPath string

The folder's path.

Properties

FolderPath

Gets the folder's full path, for plain files beside the provider's; a provider that keeps entries, not files, has nothing there.

public string FolderPath { get; }

Property Value

string

Methods

Delete(string)

Deletes a file; a missing one is passed over.

public void Delete(string name)

Parameters

name string

The file's name.

Exceptions

ArgumentException

name is a path, empty, . or ...

GetSignature(string)

Gets a signature of a file, which changes when the file is written as a rule.

public string GetSignature(string name)

Parameters

name string

The file's name.

Returns

string

The signature.

Exceptions

ArgumentException

name is a path, empty, . or ...

OpenStorage(string)

Opens a folder inside this one.

public Storage OpenStorage(string name)

Parameters

name string

The folder's name.

Returns

Storage

The folder's storage.

Exceptions

ArgumentException

name is a path, empty, . or ...

Read(string)

Reads a file's text.

public string? Read(string name)

Parameters

name string

The file's name.

Returns

string

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

Exceptions

ArgumentException

name is a path, empty, . or ...

Write(string, string)

Writes a file's text, whole or not at all.

public void Write(string name, string content)

Parameters

name string

The file's name.

content string

The text.

Exceptions

ArgumentException

name is a path, empty, . or ...