Skip to content

SFTPUtil

ClassAssetInventoryAssetInventory.Editor
public static class SFTPUtil

No description is available for this type.

public static SftpClient ConnectSFTP(FTPConnection connection, string password)

Creates and connects an SFTP client based on the connection configuration

Parameters

Name Type Description
connection AssetInventory.FTPConnection
password System.String

Returns

Renci.SshNet.SftpClient — No return description is available.

UploadDirectory(SftpClient, string, string, bool, Action<string, string>, Func)

Section titled “UploadDirectory(SftpClient, string, string, bool, Action<string, string>, Func)”
public static void UploadDirectory(SftpClient client, string localPath, string remotePath, bool recursive, Action<string, string> onFileUploaded = null, Func<bool> cancellationRequested = null)

Uploads a directory recursively to the SFTP server

Parameters

Name Type Description
client Renci.SshNet.SftpClient
localPath System.String
remotePath System.String
recursive System.Boolean
onFileUploaded System.Action{System.String,System.String}
cancellationRequested System.Func{System.Boolean}
public static void CreateRemoteDirectory(SftpClient client, string path)

Creates a directory on the remote server, including parent directories

Parameters

Name Type Description
client Renci.SshNet.SftpClient
path System.String

TestConnection(FTPConnection, string, out string)

Section titled “TestConnection(FTPConnection, string, out string)”
public static bool TestConnection(FTPConnection connection, string password, out string errorMessage)

Tests an SFTP connection

Parameters

Name Type Description
connection AssetInventory.FTPConnection
password System.String
errorMessage System.String

Returns

System.Boolean — No return description is available.