Class DirectoryUploadStoreOptions
Provides options for the directory store of chunked uploads (see AddDirectoryUploadStore(IServiceCollection, Action<DirectoryUploadStoreOptions>?)): the directory, and whether other processes use it too.
Namespace: Singulink.Net.Http.Api.Service.Uploads
Assembly: Singulink.Net.Http.Api.Service.dll
Syntax
public sealed class DirectoryUploadStoreOptions
Remarks
The store checks and freezes the options when the application starts, after which they can't be changed, and their setters throw an InvalidOperationException.
The members that are required have no default. The compiler requires them when the options are created in code, but not when they are bound from a configuration, so they read as not set until they are set, in any order, and the application fails to start, with a message that names them, if one is still not set then.
The options can be bound from a configuration section with services.Configure<DirectoryUploadStoreOptions>(section). The reflection-based
configuration binder binds Directory from a string through the type converter of Singulink.IO.FileSystem, which reads it as a path of the
platform the app runs on, with None, and the directory then must have friendly names. The configuration binding source
generator doesn't use type converters and leaves Directory unset, so an app that uses it sets the directory in the action passed to
AddDirectoryUploadStore(IServiceCollection, Action<DirectoryUploadStoreOptions>?), from a path that it parses, such as with
ParseAbsolute(ReadOnlySpan<char>, PathOptions).
Constructors
| Name | Description |
|---|---|
| DirectoryUploadStoreOptions() | Initializes a new instance of the DirectoryUploadStoreOptions class. |
| DirectoryUploadStoreOptions(IAbsoluteDirectoryPath, StoreSharingMode) | Initializes a new instance of the DirectoryUploadStoreOptions class with the directory and whether other processes use it too. |
Properties
| Name | Description |
|---|---|
| Directory | Gets or sets the directory that the store keeps uploads in, or null while it is not set. |
| IsFrozen | Gets a value indicating whether the options are in use: the directory store checked them (see Validate()) when it took them, and they can no longer be changed. |
| SharingMode | Gets or sets whether other processes use Directory too, such as the other servers of a service that share it (Shared), or only this process does (ProcessLocal). It is Unspecified while it is not set. |
Methods
| Name | Description |
|---|---|
| Validate() | Checks the options as the directory store does when it takes them. The required Directory and SharingMode are set. |