Indiko.Blocks.Storage.Abstractions
4.0.0
dotnet add package Indiko.Blocks.Storage.Abstractions --version 4.0.0
NuGet\Install-Package Indiko.Blocks.Storage.Abstractions -Version 4.0.0
<PackageReference Include="Indiko.Blocks.Storage.Abstractions" Version="4.0.0" />
<PackageVersion Include="Indiko.Blocks.Storage.Abstractions" Version="4.0.0" />
<PackageReference Include="Indiko.Blocks.Storage.Abstractions" />
paket add Indiko.Blocks.Storage.Abstractions --version 4.0.0
#r "nuget: Indiko.Blocks.Storage.Abstractions, 4.0.0"
#:package Indiko.Blocks.Storage.Abstractions@4.0.0
#addin nuget:?package=Indiko.Blocks.Storage.Abstractions&version=4.0.0
#tool nuget:?package=Indiko.Blocks.Storage.Abstractions&version=4.0.0
Indiko.Blocks.Storage.Abstractions
Storage contracts and option models for pluggable file storage providers.
Overview
This package defines the core storage abstractions used by concrete providers (local file system, Azure Blob, S3).
Key Components
IFileProviderIStorageBlockStorageOptionsStorageOptionsExtensions(shared extension and size validation)StoragePath(key building and file-name validation)SizeLimitedReadStream(size enforcement while streaming)
IFileProvider Responsibilities
The provider interface includes operations for:
- saving content and stream/file uploads,
- loading file bytes or opening a stream (
OpenReadAsync), - deleting, copying, moving files,
- reading file lists and metadata,
- producing a time-limited URL (
GetPresignedUrlAsync).
OpenReadAsync and GetPresignedUrlAsync carry default implementations, so an existing
implementation of the interface keeps compiling: the former falls back to GetFileAsync and
buffers, the latter throws NotSupportedException. Providers that can do better override them.
Configuration
StorageOptions:
EnabledMaxFileSize(in megabytes)AllowedFileTypes
AllowedFileTypes is compared case-insensitively and independently of a leading dot, so
"png" and ".PNG" are equivalent. An empty or unset list rejects every upload.
Shared Helpers
Both rules every provider has to enforce -- allowed extension, maximum size -- live in
StorageOptionsExtensions rather than being re-implemented per backend:
options.EnsureFileTypeAllowed(fileExtension, logger);
options.EnsureSizeWithinLimit(content.Length, logger);
var maximum = options.GetMaxFileSizeInBytes();
StoragePath turns a caller-supplied name into a key or path and rejects anything that would
escape the configured root (.., a rooted path, a drive letter). CombineKey drops an empty
prefix instead of producing a leading slash.
SizeLimitedReadStream wraps a forward-only stream and fails once the limit is passed, so a
provider can stream an upload without buffering it to measure its length first.
Runtime Notes
- This package contains contracts and shared helpers; no backend is implemented here.
- Providers are expected to enforce size/type validation and throw the exceptions from
Indiko.Blocks.Common.Abstractions.Exceptions. - Only one storage provider can be active per application: they all register
IFileProviderunder the same contract.
Minimal Usage
public sealed class MyProvider : IFileProvider
{
// implement required methods
}
Target Framework
- .NET 10
Related Packages
Indiko.Blocks.Storage.LocalIndiko.Blocks.Storage.AzureBlobStorageIndiko.Blocks.Storage.S3
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- CommunityToolkit.Diagnostics (>= 8.4.2)
- Indiko.Blocks.Common.Abstractions (>= 4.0.0)
- Microsoft.Extensions.Options (>= 10.0.12)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Indiko.Blocks.Storage.Abstractions:
| Package | Downloads |
|---|---|
|
Indiko.Blocks.Storage.Local
Building Blocks Storage Local |
|
|
Indiko.Blocks.Storage.AzureBlobStorage
Building Blocks Storage Azure Blob Storage |
|
|
Indiko.Blocks.Storage.S3
Building Blocks Storage S3 (Amazon S3 and S3-compatible object storage) |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.0 | 49 | 10/1/2026 |
| 3.0.1 | 78 | 9/30/2026 |
| 3.0.0 | 54 | 9/30/2026 |
| 2.9.1 | 360 | 8/20/2026 |
| 2.9.0 | 132 | 8/20/2026 |
| 2.8.0 | 407 | 5/22/2026 |
| 2.7.8 | 181 | 5/7/2026 |
| 2.7.7 | 138 | 5/7/2026 |
| 2.7.6 | 197 | 4/23/2026 |
| 2.7.5 | 201 | 4/23/2026 |
| 2.7.4 | 150 | 4/23/2026 |
| 2.7.3 | 148 | 4/23/2026 |
| 2.7.2 | 137 | 4/23/2026 |
| 2.7.1 | 139 | 4/23/2026 |
| 2.7.0 | 140 | 4/23/2026 |
| 2.6.4 | 150 | 4/21/2026 |
| 2.6.3 | 126 | 4/21/2026 |
| 2.6.2 | 139 | 4/21/2026 |
| 2.6.1 | 144 | 4/18/2026 |
| 2.6.0 | 141 | 4/17/2026 |