qie.listFTPEndpointImplicitTLS¶
Signature: qie.listFTPEndpointImplicitTLS(host, port, path, binary, passive, ftpParameters, userName, password)
Returns: String[] fileNames - the array of leaf file names found (not full paths)
Returns an array of leaf file names (not full paths) found in the path specified. To read a returned file with qie.readFTPFileImplicitTLS(...), create a full path by joining the source folder with the file name.
Note
QIE uses version 4.22.0 of Apache Camel. (See this article for available parameters).
Parameters¶
| Type | Name | Description | Default |
|---|---|---|---|
| String | host | hostname or ip address for the ftp server | |
| Integer | port | the port number to use | |
| String | path | file path to list files | |
| Boolean | binary | transfer data using binary protocol | |
| Boolean | passive | use passive transfer mode (usually true) | |
| String | ftpParameters | additional custom camel ftp parameters to be used by this connection. (Format: {key}={value}\n{key2}={value2}...) | |
| String | userName | username to use for this connection | |
| String | password | password to use for this connection |
Example¶
// Example: list files on an FTP endpoint using Implicit TLS.
var filesFound = qie.listFTPEndpointImplicitTLS(
'sftp.example.com', // host
990, // port (FTP Implicit TLS default)
'*.txt', // path (pattern to list)
false, // binary
true, // passive
'', // ftp parameters
'interfaceUser', // username
'yourPassword' // password
);
if (filesFound && filesFound.length) {
for (var i = 0; i < filesFound.length; i++) {
qie.debug("Found file: " + filesFound[i]);
}
} else {
qie.debug("No files found on the FTP server");
}