The /system/sftp container includes functions used to connect to the SSH server with SFTP support. The /system/sftp functions enable you to perform operations such as uploading and retrieving files, creating and removing directories, deleting files, and others. In terms of path conventions, the /system/sftp functions have the same characteristics as the /system/ftp functions. However, the /system/sftp functions use a different protocol and require that the connection to the server be established in a separate FlowForce step. Once you have established the SFTP connection, you can use it in further steps to do the required operations (see screenshot below).
In the example job illustrated above, two steps have been defined:
•The first step establishes the SFTP connection and declares this object as my_sftp_connection (first red rectangle in screenshot above).
•The second step retrieves all the files from the current directory of the SFTP server and outputs them to the local working directory C:\Local. The first parameter points to the my_sftp_connection object declared in the first execution step (second red rectangle in screenshot above).
Some parameters can be set to <Expression> (e.g., Login credentials). To find out more about expressions, see FlowForce Expressions.
The following SFTP functions accept wildcards as parameters:
•/system/sftp/list-directories
•/system/sftp/retrieve-wildcard
When using such functions, you can enter the following wildcards:
Wildcard |
Usage |
Example |
---|---|---|
* |
Match zero or more characters. |
*.htm will match home.htm and index.htm |
? |
Match any single character. |
*.xm? will match index.xml and project.xmi |
The + (one or more) wildcard is not supported. Instead, you can use ?* to achieve the same effect. For example, *.c?* will match .cs , .cp and .csproj files but will not match .c files.