Skip to content

FTPActionStep

ClassAssetInventoryAssetInventory.Editor
public abstract class FTPActionStep : ActionStep

Base class for FTP/SFTP action steps with common functionality.

protected void AddServerParameter()

Adds the FTP/SFTP server connection parameter to the step. Uses lazy loading to defer FTP connections lookup until the parameter is displayed.

protected List<Tuple<string, ParameterValue>> BuildServerOptions()

Builds the list of available FTP/SFTP server connections. Called on-demand when the parameter options are needed.

Returns

System.Collections.Generic.List{System.Tuple{System.String,Automator.ParameterValue}}

public override List<Tuple<string, ParameterValue>> GetParamOptions(StepParameter param, List<ParameterValue> parameters)

Override to provide lazy-loaded options for the Server parameter.

Parameters

Name Type
param Automator.StepParameter
parameters System.Collections.Generic.List{Automator.ParameterValue}

Returns

System.Collections.Generic.List{System.Tuple{System.String,Automator.ParameterValue}}

TryGetConnection(string, out FTPConnection, out string)

Section titled “TryGetConnection(string, out FTPConnection, out string)”
protected bool TryGetConnection(string connectionId, out FTPConnection connection, out string password)

Gets and validates an FTP connection from parameters.

Parameters

Name Type Description
connectionId System.String The connection ID from parameters.
connection AssetInventory.FTPConnection The validated connection, or null if validation fails.
password System.String The decrypted password, or empty string if validation fails.

Returns

System.Boolean: True if connection is valid, false otherwise.

protected string GetProtocolName(FTPConnection connection)

Gets the protocol name for logging purposes.

Parameters

Name Type
connection AssetInventory.FTPConnection

Returns

System.String

protected string GetFtpScheme(FTPConnection connection)

Builds the FTP URI scheme (ftp, ftps, or sftp).

Parameters

Name Type
connection AssetInventory.FTPConnection

Returns

System.String

ConfigureFtpSsl(FtpWebRequest, FTPConnection)

Section titled “ConfigureFtpSsl(FtpWebRequest, FTPConnection)”
protected void ConfigureFtpSsl(FtpWebRequest request, FTPConnection connection)

Configures SSL settings for an FTP request.

Parameters

Name Type
request System.Net.FtpWebRequest
connection AssetInventory.FTPConnection

CreateFtpRequest(FTPConnection, string, string, bool)

Section titled “CreateFtpRequest(FTPConnection, string, string, bool)”
protected FtpWebRequest CreateFtpRequest(FTPConnection connection, string remotePath, string password, bool keepAlive = false)

Creates a basic FTP request with common settings.

Parameters

Name Type
connection AssetInventory.FTPConnection
remotePath System.String
password System.String
keepAlive System.Boolean

Returns

System.Net.FtpWebRequest

protected void ResetSslValidation()

Resets the SSL certificate validation callback to default. Should be called in finally blocks after FTP operations.

protected FTPActionStep()