Listing all files/folders on the FTP root directory - 7.0

FTP

author
Talend Documentation Team
EnrichVersion
7.0
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance > Third-party systems > Internet components (Integration) > FTP components
Data Quality and Preparation > Third-party systems > Internet components (Integration) > FTP components
Design and Development > Third-party systems > Internet components (Integration) > FTP components
EnrichPlatform
Talend Studio
Configure the tFTPFileList component, the tIterateToFlow component, and the tLogRow component to iterate all files and folders on the FTP root directory and display the names and paths of these files and folders on the console of Talend Studio .

Procedure

  1. Double-click the tFTPFileList component to open its Basic settings view.
  2. Specify the connection details required to access the FTP server. In this example, select the Use an existing connection check box and from the Component list drop-down list displayed, select the connection component to reuse its connection details you have already defined.
  3. In the Remote directory field, specify the FTP server directory on which the files and folders will be iterated. In this example, it is /, which means the root directory of the FTP server.
  4. Clear the Move to the current directory check box.
  5. Double-click the tIterateToFlow component to open its Basic settings view.
  6. Click the button next to Edit schema to open the schema dialog box.
  7. Click the button to add two String type columns filename and filepath that will hold the names and paths of the files to be iterated respectively. When done, click OK to close the dialog box.
  8. In the Mapping table, set the values for the filename and filepath columns. In this example, the global variable ((String)globalMap.get("tFTPFileList_1_CURRENT_FILE")) for filename and the global variable ((String)globalMap.get("tFTPFileList_1_CURRENT_FILEPATH")) for filepath.

    Note that you can fill the values by pressing Ctrl + Space to access the global variables list and then selecting tFTPFileList_1_CURRENT_FILE and tFTPFileList_1_CURRENT_FILEPATH from the list.

  9. Double-click the tLogRow component to open its Basic settings view, and then select Table (print values in cells of a table) in the Mode area for better readability of the result.