Cloud.File.Storage.Manager.Common
3.1.0
dotnet add package Cloud.File.Storage.Manager.Common --version 3.1.0
NuGet\Install-Package Cloud.File.Storage.Manager.Common -Version 3.1.0
<PackageReference Include="Cloud.File.Storage.Manager.Common" Version="3.1.0" />
<PackageVersion Include="Cloud.File.Storage.Manager.Common" Version="3.1.0" />
<PackageReference Include="Cloud.File.Storage.Manager.Common" />
paket add Cloud.File.Storage.Manager.Common --version 3.1.0
#r "nuget: Cloud.File.Storage.Manager.Common, 3.1.0"
#:package Cloud.File.Storage.Manager.Common@3.1.0
#addin nuget:?package=Cloud.File.Storage.Manager.Common&version=3.1.0
#tool nuget:?package=Cloud.File.Storage.Manager.Common&version=3.1.0
Cloud File Storage Manager
It is the common basis of file manager nuget packages that provides definitions for various file operations, on which any package can be built. Provides complete implementation to handle easily cloud file storage operations like get informations about files, reading, downloadURL generation, file update, file move and delete.
Path rules
Every path is relative to the root directory of the storage. Paths can be given as a single string or as segments, and every segment is split on / and \ and checked before any storage call:
- Empty or whitespace segments, segments made only of dots and spaces (such as
..) and segments with control characters are rejected with anArgumentException. - The same checks run on the percent-decoded forms of a segment, so encoded traversal such as
%2e%2eis rejected too. A segment whose decoded form contains/or\is rejected. - A storage package can add its own segment rules on top of these.
Root protection
The root directory itself cannot be changed: deleting it, updating it, moving it or opening a writeable local stream on it throws an InvalidOperationException. Reading it as a file or asking a download URL for it throws an ArgumentException. Asking file information for the root returns a non-existing entry.
Other behaviour
- Moving a file to its own path does nothing.
- File information objects returned by the storage can be passed back to the read, download URL, update, move and delete methods; they always resolve under the root directory.
SupportsDownloadUrltells whether the storage can generate download URLs. When it is false (Physical), the download URL methods throw aNotSupportedException.- A writeable local stream is uploaded when it is disposed, also after an exception, so partially written content is uploaded. A stream can only be committed by the storage that created it, and only to a path under its root.
ToJsonserializes the storage options, including keys, passwords and tokens, so its output must never be logged.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Cloud.File.Storage.Manager.Common:
| Package | Downloads |
|---|---|
|
Cloud.File.Storage.Manager.AzureBlob
Provides complete implementation to handle easily cloud file storage operations for Azure Blob Storage like get informations about files, reading, downloadURL generation, file update, file move and delete. |
|
|
Cloud.File.Storage.Manager.SharePoint
Provides complete implementation to handle easily cloud file storage operations for SharePoint like get informations about files, reading, downloadURL generation, file update, file move and delete. |
|
|
Cloud.File.Storage.Manager.Minio
Provides complete implementation to handle easily cloud file storage operations for Minio .NET SDK for Amazon S3 Compatible Cloud Storage like get informations about files, reading, downloadURL generation, file update, file move and delete. |
|
|
Cloud.File.Storage.Manager.Physical
Provides complete implementation to handle easily cloud file storage operations for Physical Storage like get informations about files, reading, downloadURL generation, file update, file move and delete. |
|
|
Cloud.File.Storage.Manager.AmazonS3
Provides complete implementation to handle easily cloud file storage operations for Amazon S3 like get informations about files, reading, downloadURL generation, file update, file move and delete. |
GitHub repositories
This package is not used by any popular GitHub repositories.
- Path segments are validated: empty, dot-only, control-character and percent-encoded traversal segments are rejected
- The storage root cannot be deleted, moved, overwritten or read as a file
- IFileInfo based move and download URL overloads respect the configured root directory
- Local file streams upload only to the target they were created for
- SupportsDownloadUrl tells whether a provider can issue download links
- Moving an entry onto itself is a no-op