var sftp : SFTPClient = new dw.net.SFTPClient();
sftp.connect("my.sftp-server.com", "username", "password");
var data : String = sftp.get("simple.txt");
sftp.disconnect();
The default connection timeout depends on the script context timeout and will be set to a maximum of 30 seconds
(default script context timeout is 10 seconds within storefront requests and 15 minutes within jobs).
IMPORTANT NOTE: Before you can make an outbound SFTP connection, the SFTP server IP address must be enabled
for outbound traffic at the Commerce Cloud Digital firewall for your POD. Please file a support request to request a new firewall
rule.This method associates the key to the host used in the subsequent connect method, and must be called prior to connect. The key is not persisted, and is only associated to this instance of the SFTP client.
Multiple keys may added, and the validation will succeed if the remote host matches any of them.
The default behavior is to persist and trust an unknown host key if there are no known host keys available. If addKnownHostKey is later used to trust specific a specific key or keys, then any previously persisted keys will be ignored.
null
if not present.
null
if not present.
null
if not present.
The key is only associated to this instance of the SFTP client.