Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 879 Bytes

File metadata and controls

23 lines (17 loc) · 879 Bytes

SharpGrip FileSystem Sftp adapter NuGet

Installation

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

Usage

// SFTP connection.
var privateKeyFile = new PrivateKeyFile("/home/userName/.ssh/id_rsa");
var privateKeyAuthenticationMethod = new PrivateKeyAuthenticationMethod("userName", privateKeyFile);
var sftpConnectionInfo = new ConnectionInfo("hostName", "userName", privateKeyAuthenticationMethod);
var sftpClient = new SftpClient(sftpConnectionInfo);

var adapters = new List<IAdapter>
{
    new LocalAdapter("local", "/var/files"),
    new SftpAdapter("sftp", "/var/files", sftpClient)
};

var fileSystem = new FileSystem(adapters);