Provides an implementation of Ramstack.FileSystem using Amazon S3 storage.
To install the Ramstack.FileSystem.Amazon NuGet package
in your project, run the following command:
dotnet add package Ramstack.FileSystem.Amazonusing Ramstack.FileSystem.Amazon;
AmazonS3FileSystem fs = new AmazonS3FileSystem(
accessKeyId: "...",
secretAccessKey: "...",
region: RegionEndpoint.USEast1,
bucketName: "my-storage");
// Create S3 bucket if it doesn't exist
await fs.CreateBucketAsync(AccessControl.Private);
await foreach (VirtualFile file in fs.GetFilesAsync("/"))
{
Console.WriteLine(node.Name);
}You can also configure the file system to be read-only:
AmazonS3FileSystem fs = new AmazonS3FileSystem(
accessKeyId: "...",
secretAccessKey: "...",
region: RegionEndpoint.USEast1,
bucketName: "my-storage")
{
IsReadOnly = true
};- Ramstack.FileSystem.Abstractions - Provides a virtual file system abstraction.
- Ramstack.FileSystem.Physical - Provides an implementation based on the local file system.
- Ramstack.FileSystem.Azure - Provides an implementation using Azure Blob storage.
- Ramstack.FileSystem.Google - Provides an implementation using Google Cloud storage.
- Ramstack.FileSystem.Readonly - Provides a read-only wrapper for the underlying file system.
- Ramstack.FileSystem.Globbing - Wraps the file system, filtering files and directories using glob patterns.
- Ramstack.FileSystem.Prefixed - Adds a prefix to file paths within the underlying file system.
- Ramstack.FileSystem.Sub - Wraps the underlying file system, restricting access to a specific subpath.
- Ramstack.FileSystem.Adapters - Provides integration with
Microsoft.Extensions.FileProviders. - Ramstack.FileSystem.Composite - Provides an implementation that combines multiple file systems into a single composite file system.
| Version | |
|---|---|
| .NET | 6, 7, 8, 9, 10 |
Bug reports and contributions are welcome.
This package is released as open source under the MIT License. See the LICENSE file for more details.