ArxOne / OneFilesystem

Unified filesystem to handle local files FTP, SFTP
MIT License
10 stars 1 forks source link
filesystem ftp sftp

OneFilesystem

First of all: it is released as a NuGet package. Important too: currently it is a pre-release package, because it depends on an SSH.NET package version which is prele-release too. Fortunately, things will change soon.

Why another library of this kind?

Because I found two kind of libraries:

What is does

Unified filesystem to handle local files, FTP[[E]S] and SFTP.

How it does

In a nutshell

You just need to instantiate a OneFilesystem. It contains a very few functions (detailed below). For example:

using (var oneFilesystem = new OneFilesystem())
{
    // here, we read some files
    var children = oneFilesystem.GetChildren("C:\MyDirectory");
    // now, we create another
    using (var stream = oneFilesystem.OpenRead("ftp://myserver/somefile.txt"))
    {
    }
}

Paths

OneFilesystem works with URI (where you specify "file", "ftp", "ftps", "ftpes"or "sftps" as scheme, a target host and port and a local path). You can also use plain local paths (such as "C:\Windows")

All of these path kinds are handled in a unique way by a unique class which is OnePath. Fortunately for you (and for me), there are implicit conversions from stringor Uri.

Operations

A very few and simple operations are supported (extending them is planned, but it will stay simple anyway):