Scenario: Uploading and downloading files from Box - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

In this scenario, a three-component Job consisting of three Subjobs is created to upload a file to Box and then download a file from Box to the local file system.

Before replicating this scenario, you need to create an account at https://developers.box.com/ and then create a Box App under the Box account to be used. For more information about Box App, see https://app.box.com/developers/services/edit/. The client key and client secret can be obtained from the account application settings. For how to get the access token and refresh token, check the Box documentation you can access from https://developers.box.com/.

Linking the components

  1. In the Integration perspective of the Studio, create an empty Job from the Job Designs node in the Repository tree view.

    For further information about how to create a Job, see Talend Studio User Guide.

  2. In the workspace, enter the name of the component to be used and select this component from the list that opens. In this scenario, the components are tBoxConnection, tBoxPut and tBoxGet.

  3. Connect tBoxConnection to tBoxPut using the Trigger > OnSubjobOk link.

  4. Connect tBoxPut to tBoxGet using the Trigger > OnSubjobOk link.

Configuring the components

  1. Double-click tBoxConnection to open its Component view.

  2. Enter the client key, client secret, access token and refresh token in double quotation marks in the relevant fields for accessing the Box account.

  3. Double-click tBoxPut to open its Component view.

  4. Select the Use Existing Connection check box to reuse the connection created by tBoxConnection.

    In the Remote Path field, enter the destination path where you want to upload the file.

    In the Upload mode area, select Upload Local File. In the File field, enter the file path or browse to the file you want to upload.

  5. Double-click tBoxGet to open its Component view.

  6. Select the Use Existing Connection check box to reuse the connection created by tBoxConnection.

    In the Path field, enter the path of the file that you want to download.

    Select the Save As File check box. In the Save To field, enter the file path where to save the file on the local file system.

  7. Save the Job.

Executing the Job

Execute the Job by pressing F6 or clicking the Run button on the Run tab.

The local file, hello.txt in this example, is uploaded in your Box.

The file box.txt from Box is downloaded to the local file system.