Method EnsureCreated
EnsureCreated()
Ensures that the file repository exists at the configured base directory, creating or repairing the required directory structure as necessary. May also acquire the repository lock for an instance session via a subsequent operation.
Declaration
public void EnsureCreated()
Remarks
If the base directory does not exist or is empty, it is created and initialized as a FulcrumFS repository.
If the base directory contains an existing FulcrumFS repository (identified by the presence of the InfoFileName marker file), any missing required subdirectories are restored. Foreign files and folders alongside the repository are left untouched.
If the base directory exists, contains foreign content, and is not already a FulcrumFS repository, an exception is thrown rather than initializing the directory as a repository.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The base directory contains content that does not belong to a FulcrumFS repository. |
| NotSupportedException | The repository was created by a newer incompatible version of FulcrumFS. |
| InvalidDataException | The repository info file is malformed. |