/n software Connectors for MuleSoft

Questions / Feedback?

SFTP Connector

Properties   Configuration Settings  

The SFTP Component adds SSH-secured file transfer capabilities to your MuleSoft.

Remarks

The SFTP Connector adds a complete SFTP client to your Mule Project that enables it with SSH-secured file download and upload functionality.

SFTP Receive Connector

The SFTP Receive Connector will establish a connection to a server and download a group of files The SFTP Receive Connector requires that a single property be set: SSHHost. You may also set an SSHPort if the server is not running on the default SSH port. In order to authenticate with the SSH server, you will need to specify an SSHUser, and either SSHPassword or SSHCert depending upon the SSHAuthMode to be used.

The connector will connect to the SFTP server every PollingInterval and list the directory specified by RemotePath. All files that match the FileMask will be downloaded and submitted to the Mule Project as individual Mule Messages. In order to guarantee that files are not downloaded multiple times, you may set the DeleteMode.

Download Example

Drag and drop the SFTP Receive Connector into the source position of a flow. All that is necessary to get started is to configure the connection settings.

Just as an example, say you want to download a group of files stored on a remote machine in /home/Bob/files.

To configure the connector, one option is to specify a RemotePath of /home/Bob/files and an empty FileMask. Since FileMask defaults to *.*, all files in the RemotePath will be downloaded.

One mule event will be generated for each downloaded file. You can use a File Write connector behind the SFTP Receive connector to write the files to disk.

The received filename is available in the ReceivedFileName attribute on each Mule Message. To write the entire group of files to disk, you can set the Path property of the File Write connector to the following DataWeave code:


"C:\\my\\files\\" ++ attributes.ReceivedFileName

The Content can be left as payload. That is all that is required to begin downloading files.

SFTP Send Connector

The SFTP Send Connector will establish a connection to a server and upload a file. The bytes in the payload of the incoming Mule Message will be uploaded as a single file. The SFTP Send Connector requires both an SSHHost and a RemoteFile. You may also set an SSHPort if the server is not running on the default SSH port. In order to authenticate with the SSH server, you will need to specify an SSHUser, and either SSHPassword or SSHCert depending upon the SSHAuthMode to be used.

The connector will connect to the SFTP server whenever it has a message to send. The connector will attempt to upload to the specified RemotePath. If Overwrite is set to True, the connector will delete or overwrite remote files as necessary to complete the operation.

In order to prevent parallel processing by another application before your upload is complete, you may need to set a temporary upload directory via RemoteTempPath. If the temporary directory is set, the file will first be uploaded to the specified temporary directory, and will be moved to the final destination path once the upload has completed.

Upload Single Example

Add a File Read connector in front of the SFTP Send connector and configure it to read a particular target file. There is no need to transform the output of the File Read connector before passing it to the SFTP Send connector. Configure the SFTP Send connector with the above connection settings. That is all that is required to upload the file.

Upload Multiple Example

The Send operation only uploads a single file at a time so we will need to perform the Send operation once for each file.

To get started, add a File List connector to your flow and configure it to list a target folder. Behind the File List connector add a For Each Scope and configure it to iterate over the message payload. Inside the For Each Scope, add a SFTP Send operation and configure it with the above connection settings.

Set the RemoteFile property dynamically with DataWeave to preserve the uploaded filename. To do this, click the Mule Expression indicator on the RemoteFile property and add the following DataWeave code:


"/home/Spencer/files" ++ attributes.fileName

That is all that is required to upload a group of files.

Receiver Property List


The following is the full list of the properties of the receiver connector with short descriptions. Click on the links for further details.

AfterConnectA set of FTP-style commands to be executed immediately after connecting to the SSHHost .
AfterGetA set of FTP-style commands to be executed after the download.
BeforeGetA set of FTP-style commands to be executed before the download.
DeleteModeControls if and when the remote file is deleted after download.
FileMaskIndicates the type of files to download from the SSH server.
FirewallA set of properties related to firewall access.
LogFileThe file to write logging information to at runtime.
LogModeWhat information gets logged during component execution.
LogTypeHow information gets logged during component execution.
OtherDefines a set of configuration settings to be used by the component.
PersistentConnectionInstructs the component whether to keep the connection to the server open.
ReceivedFileDateThe date of the remote file received by the SFTP component.
ReceivedFileNameThe name of the remote file received by the SFTP component.
ReceivedFilePathThe remote path of the file received by the SFTP component.
ReceivedFileSizeThe size of the remote file received by the SFTP component.
ReceivedFileSSHUserThe SSH user name used by the SFTP component when downloading the remote file.
RemotePathThe current path on the SSH server.
RuntimeLicenseSpecifies the component runtime license key.
SSHAcceptServerHostKeyInstructs the component to accept the server host key that matches the supplied key.
SSHAuthModeThe type of authentication used by the component.
SSHCertThe certificate to use for client authentication during the SSH handshake.
SSHCompressionAlgorithmsA comma-separated list of compression algorithms allowed for this connection.
SSHHostThe address of the SSH host.
SSHPasswordThe password for SSH password-based authentication.
SSHPortThe port on the SSH server where the SSH service is running; by default, 22.
SSHUserThe username for SSH authentication.
TempPathA temporary local directory where data can be stored before the component processes it.
TimeoutA timeout for the component.

Sender Property List


The following is the full list of the properties of the sender connector with short descriptions. Click on the links for further details.

AfterConnectA set of FTP-style commands to be executed immediately after connecting to the SSHHost .
AfterPutA set of FTP-style commands to be executed after the upload.
AppendWhether or not the component should append data to the RemoteFile .
BeforePutA set of FTP-style commands to be executed before the upload.
FirewallA set of properties related to firewall access.
LogFileThe file to write logging information to at runtime.
LogModeWhat information gets logged during component execution.
LogTypeHow information gets logged during component execution.
OtherDefines a set of configuration settings to be used by the component.
OverwriteWhether or not the component should overwrite files during transfer.
PersistentConnectionInstructs the component whether to keep the connection to the server open.
RemoteFileThe name of the destination file on the SSH server for uploading.
RemotePathThe current path on the SSH server.
RemoteTempPathA temporary directory on the server to store files before moving them to RemotePath .
RuntimeLicenseSpecifies the component runtime license key.
SSHAcceptServerHostKeyInstructs the component to accept the server host key that matches the supplied key.
SSHAuthModeThe type of authentication used by the component.
SSHCertThe certificate to use for client authentication during the SSH handshake.
SSHCompressionAlgorithmsA comma-separated list of compression algorithms allowed for this connection.
SSHHostThe address of the SSH host.
SSHPasswordThe password for SSH password-based authentication.
SSHPortThe port on the SSH server where the SSH service is running; by default, 22.
SSHUserThe username for SSH authentication.
TimeoutA timeout for the component.

Configuration Settings


The following is a list of configuration settings for the connector with short descriptions. Click on the links for further details.

DisableRealPathControls whether or not the SSH_FXP_REALPATH request is sent.
DownloadCacheFileWhen set, only new files will be downloaded from the server.
DownloadCacheFileDurationThe number of minutes that a file name will remain in the download cache.
EnableFileDetailsComparisonWhether the receive component should consider metadata differences when deciding whether to download a file again.
ExcludeMaskInstructs the component to exclude some files when downloading.
FileMaskDelimiterSpecifies a delimiter to use for setting multiple file masks.
FilePermissionsSpecifies the permissions of a file to be set after a successful upload.
IgnoreFileMaskCasingInstructs the component to ignore casing of when FileMask is set.
KeyRenegotiationThresholdSets the threshold for the SSH Key Renegotiation.
ListDirBeforeDownloadDetermines if the directory is listed on download.
LocalEOLWhen TransferMode is set, this specifies the line ending for the local system.
LogSSHPacketsIf True, detailed SSH packet logging is performed.
MaxFileDataSpecifies the maximum payload size of an SFTP packet.
MaxFilesPerPollingIntervalThe maximum number of files that will be downloaded from the server during a single poll.
ProtocolVersionThe highest allowable SFTP version to use.
RenameModeThe condition under which RenameTo is used.
RenameToA filename to which RemoteFile will be renamed.
ServerEOLWhen TransferMode is set, this specifies the line ending for the remote system.
SortCriteriaDetermines sort order before downloading files.
SSHAcceptServerHostKeyFingerPrintInstructs the component to accept the server's host key with this fingerprint.
SSHEncryptionAlgorithmsA comma-separated list containing all allowable compression algorithms.
SSHFingerprintHashAlgorithmThe algorithm used to calculate the fingerprint.
SSHKeyExchangeAlgorithmsSpecifies the supported key exchange algorithms.
SSHMacAlgorithmsSpecifies the supported Mac algorithms.
SSHPublicKeyAlgorithmsSpecifies the supported public key algorithms.
TemporaryDownloadExtensionAn extension to be appended during download.
TemporaryUploadExtensionAn extension to be appended during upload.
TransferModeThe transfer mode (ASCII or Binary).
WaitForServerDisconnectCauses the component to wait for the server to close the connection.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
LocalHostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
TcpNoDelayWhether or not to delay when sending packets.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
/n software Connectors for MuleSoft - Version 20.0 [Build 8318]