Configuring file existence verification - 7.1

SCP

EnrichVersion
7.1
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
EnrichPlatform
Talend Studio
task
Data Governance > Third-party systems > Internet components (Integration) > SCP components
Data Quality and Preparation > Third-party systems > Internet components (Integration) > SCP components
Design and Development > Third-party systems > Internet components (Integration) > SCP components

Procedure

  1. Double-click the tSCPFileExists component to open its Basic settings view.
  2. Select the Use an existing connection check box and then select the connection you have configured from the Component List.
  3. In the Filename field, enter the name of the file to be checked between double quotes. In this example, it is “testscp.txt”.
  4. Double-click the tJava component to open its Basic settings view.
  5. In the Code field, enter the following code:
    System.out.println((String)globalMap.get("tSCPFileExists_1_FILENAME"));
    System.out.println((String)globalMap.get("tSCPFileExists_1_STATUS"));
  6. Select the Component tab and click the If connection to open its Basic settings view.
  7. In the Condition field, enter the following code:
    !((String)globalMap.get("tSCPFileExists_1_STATUS")).equals("File exists.")
    This way, if the file doesn't exist in the defined directory, the rest of the Job will be executed.