All Projects → sparkeh9 → Enchilada

sparkeh9 / Enchilada

Licence: MIT license
Enchilada is a filesystem abstraction layer written in C#

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Enchilada

Pyfilesystem2
Python's Filesystem abstraction layer
Stars: ✭ 1,256 (+4231.03%)
Mutual labels:  filesystem, ftp
pyftpsync
Synchronize directories using FTP(S), SFTP, or file system access.
Stars: ✭ 85 (+193.1%)
Mutual labels:  filesystem, ftp
Lexical.FileSystem
Virtual IFileSystem interfaces, and implementations.
Stars: ✭ 24 (-17.24%)
Mutual labels:  filesystem, abstraction
kafka-connect-fs
Kafka Connect FileSystem Connector
Stars: ✭ 107 (+268.97%)
Mutual labels:  filesystem, ftp
Vscode Remote Workspace
Multi protocol support for handling remote files like local ones in Visual Studio Code.
Stars: ✭ 197 (+579.31%)
Mutual labels:  filesystem, ftp
Online Ftp S3
Online FTP / Amazon S3 Filebrowser
Stars: ✭ 157 (+441.38%)
Mutual labels:  filesystem, ftp
anyfs
Portable file system for Node
Stars: ✭ 17 (-41.38%)
Mutual labels:  filesystem, ftp
Go Billy
The missing interface filesystem abstraction for Go
Stars: ✭ 184 (+534.48%)
Mutual labels:  filesystem, abstraction
php-ftp-client
📦 Provides helper classes and methods to manage FTP files in an OOP way.
Stars: ✭ 81 (+179.31%)
Mutual labels:  filesystem, ftp
flysystem-curlftp
Flysystem Adapter for the FTP with cURL implementation
Stars: ✭ 36 (+24.14%)
Mutual labels:  filesystem, ftp
crunchdb
A simple JSON based database system written in PHP. Useful for smaller applications.
Stars: ✭ 32 (+10.34%)
Mutual labels:  filesystem
BlazoredLocalStorage
This library has been moved to the Blazored org
Stars: ✭ 26 (-10.34%)
Mutual labels:  aspnetcore
lfs
Lightweight file system
Stars: ✭ 12 (-58.62%)
Mutual labels:  filesystem
Analytics
Wangkanai Analytics is a .NET Core library extension that tracks and generates details statistics about visitors to your website.
Stars: ✭ 19 (-34.48%)
Mutual labels:  aspnetcore
-LibraryOS-Exokernel Implementation
Exokernel is one of the major sources for container and library OS techniques.
Stars: ✭ 41 (+41.38%)
Mutual labels:  filesystem
Windows-System-Wide-Filter
Windows WDM driver filters to filter IO to devices and file systems
Stars: ✭ 49 (+68.97%)
Mutual labels:  filesystem
AspNetCoreServiceBus
ASP.NET Core with Azure Service Bus
Stars: ✭ 95 (+227.59%)
Mutual labels:  aspnetcore
glob
Pure Nim library for matching file paths against Unix style glob patterns.
Stars: ✭ 58 (+100%)
Mutual labels:  filesystem
twisted-honeypots
SSH, FTP and Telnet honeypots based on Twisted
Stars: ✭ 79 (+172.41%)
Mutual labels:  ftp
PHP-FileUpload
Simple and convenient file uploads — secure by default
Stars: ✭ 53 (+82.76%)
Mutual labels:  filesystem

Enchilada

Build Status: Windows

What is it?

Enchilada is a filesystem abstraction layer written in C#, the aim is to enable the seamless use of file operations over and between different providers.

Implemented:

  • Local Filesystem - (local)
  • Azure Blob Storage - (azure-blob)
  • FTP/S - (ftp)

Planned:

  • SCP (Secure Copy)
  • AWS S3

How to contribute

  1. Fork
  2. Hack!
  3. Pull Request

Nuget Packages

Usage

To reference a file, simply inject the filesystem resolver (IEnchiladaFilesystemResolver) into your code, which will normally be a single instance of Enchilada.Infrastructure.EnchiladaFileProviderResolver. Once injected, simply pass in a URI (see below) to IEnchiladaFilesystemResolver.OpenFileReference, which will produce an instance of IFile, which represents the file on whatever platform your configuration specifies, regardless of whether it exists yet or not.

fileSystemResolver.OpenFileReference( "enchilada://blob_storage/image.jpg" );

The URI is made up of three parts:

  • The scheme: Simply by convention this is normally enchilada://, but any such scheme can be specified
  • The provider name: This mirrors the configurations you have specified in the appsettings file. It can be anything which looks like a valid URI hostname, however it must have a corresponding configuration.
  • The path: as you might imagine, this is the path to the file.

Saving a file from a stream

// Injected filesystem resolver
IEnchiladaFilesystemResolver enchilada;

var tempFile = new FileInfo( "C:\\test.png" );
using ( var filestream = tempFile.OpenReadStream() )
{
	using ( var fileReference = enchilada.OpenFileReference( filepath ) )
	{
	    await fileReference.CopyFromAsync( filestream );
	}
}

Local

The local adapter allows the resolution of files on the local filesystem or UNC path. It does not currently handle connecting to resources which require authentication.

"your_configuration_name": {
	"adapter": "local",
	"directory": "C:\\my-folder"
}

Azure Blob

The Azure Blob (Binary Large Object) adapter allows the resolution of files on the azure service. Authentication is handled via the connection string.

"your_configuration_name": {
	"adapter": "azure-blob",
	"connectionString": "UseDevelopmentStorage=true;",
	"containerReference": "test",
	"createContainer": true,
	"isPublicAccess": true
}

FTP

The FTP adapter enables non-encrypted file transfer to a passive mode FTP server.

"your_configuration_name": {
	"adapter": "ftp",
	"host": "ftp.github.com",
	"port": "21",
	"directory": "/sub/folder",
	"username": "[email protected]",
	"password": "$up3r.$3cur3.p4$$w0rd"
}

AspNetCore configuration

Enchilada.AspNetCore comes with functionality to plumb your app settings configuration, straight into the AspNetCore Dependency Injection framework. To configure, simply amend the ConfigureServices method in Startup.cs as follows.

services.AddEnchilada( new EnchiladaBuilderOptions
                        {
                            Adapters = Configuration.GetSection( "Enchilada:Adapters" )
                        } );

And provide configuration in the appsettings file, e.g.

{
  "Enchilada": {
    "Adapters": {
      "local_filesystem": {
        "adapter": "local",
        "directory": "C:\\my-folder"
      },
      "blob_storage": {
        "adapter": "azure-blob",
        "connectionString": "UseDevelopmentStorage=true;",
        "containerReference": "test",
        "createContainer": true,
        "isPublicAccess": true
      }
    }
  }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].