Gitpedia

FileSystem

SharpGrip FileSystem is a file system abstraction supporting multiple adapters.

From SharpGrip·Updated May 22, 2026·View on GitHub·

SharpGrip FileSystem is a versatile .NET file system abstraction that supports multiple storage adapters. It empowers developers to manage various file systems and services through a unified and easily comprehensible API. By coding against the abstractions provided by this library, developers can sidestep vendor-specific APIs, effectively avoiding vendor lock-ins. This flexibility enhances the portability and maintainability of the codebase, allowing for smoother transitions between different fi... The project is written primarily in C#, distributed under the MIT License license, first published in 2019. Key topics include: amazon-s3, azure-blob-storage, azure-file-storage, csharp, dotnet.

Latest release: v1.2.1
August 31, 2024View Changelog →

SharpGrip FileSystem NuGet

Builds

FileSystem [Build]

Quality Gate Status
Maintainability Rating
Reliability Rating
Security Rating
Coverage

Introduction

SharpGrip FileSystem is a versatile .NET file system abstraction that supports multiple storage adapters.
It empowers developers to manage various file systems and services through a unified and easily comprehensible API.
By coding against the abstractions provided by this library, developers can sidestep vendor-specific APIs, effectively avoiding vendor lock-ins.
This flexibility enhances the portability and maintainability of the codebase, allowing for smoother transitions between different file systems.

Installation

Reference NuGet package SharpGrip.FileSystem (https://www.nuget.org/packages/SharpGrip.FileSystem).

For adapters other than the local file system (included in the SharpGrip.FileSystem package) please see the Supported adapters section.

Supported adapters

AdapterPackageNuGet
Local adapterSharpGrip.FileSystemNuGet NuGet
AmazonS3SharpGrip.FileSystem.Adapters.AmazonS3NuGet NuGet
AzureBlobStorageSharpGrip.FileSystem.Adapters.AzureBlobStorageNuGet NuGet
AzureFileStorageSharpGrip.FileSystem.Adapters.AzureFileStorageNuGet NuGet
DropboxSharpGrip.FileSystem.Adapters.DropboxNuGet NuGet
FTPSharpGrip.FileSystem.Adapters.FtpNuGet NuGet
GoogleCloudStorageSharpGrip.FileSystem.Adapters.GoogleCloudStorageNuGet NuGet
GoogleDriveSharpGrip.FileSystem.Adapters.GoogleDriveNuGet NuGet
MicrosoftOneDriveSharpGrip.FileSystem.Adapters.MicrosoftOneDriveNuGet NuGet
SFTPSharpGrip.FileSystem.Adapters.SftpNuGet NuGet

Supported operations

For a full list of the supported operations please see the IFileSystem interface.

Usage

Instantiation

var adapters = new List<IAdapter>
{
    new LocalAdapter("adapterPrefix", "adapterRootPath")
};

// Instantiation option 1.
var fileSystem = new FileSystem(adapters);

// Instantiation option 2.
var fileSystem = new FileSystem();
fileSystem.Adapters = adapters;

Local adapter

var adapters = new List<IAdapter>
{
    new LocalAdapter("local1", "/var/files"),
    new LocalAdapter("local2", "D:\\Files")
};

var fileSystem = new FileSystem(adapters);

Example operations

// Azure connection.
var azureClient = new ShareClient("connectionString", "shareName");

// Dropbox connection.
var dropboxClient = new DropboxClient("oAuth2AccessToken");

var adapters = new List<IAdapter>
{
    new LocalAdapter("local", "/var/files"),
    new AzureFileStorageAdapter("azure", "/Files", azureClient),
    new DropboxAdapter("dropbox", "/Files", dropboxClient)
};

// Copies a file from the `local` adapter to the `azure` adapter.
await fileSystem.CopyFileAsync("local://foo/bar.txt", "azure://bar/foo.txt");

// Moves a file from the `azure` adapter to the `dropbox` adapter.
await fileSystem.MoveFileAsync("azure://Foo/Bar.txt", "dropbox://Bar/Foo.txt");

// Writes string contents to the `azure` adapter.
await fileSystem.WriteFileAsync("azure://Foo.txt", "Bar!");

// Reads a text file from the `dropbox` adapter.
var contents = fileSystem.ReadTextFileAsync("dropbox://Foo.txt");

Contributors

Showing top 2 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from SharpGrip/FileSystem via the GitHub API.Last fetched: 5/31/2026