# tGoogleDriveGet

Gets a file's content and downloads the file to a local directory.

## tGoogleDriveGet Standard properties

These properties are used to configure tGoogleDriveGet running in the Standard Job framework.

The Standard tGoogleDriveGet component belongs to the Cloud family.

The component in this framework is available in all Talend products.

## Basic settings

| Properties | Description |
| --- | --- |
| Property Type | Select the way the connection details<br>will be set.<br><br><ul> <li> <p> <span>Built-In</span>: The connection details will be set                                locally for this component. You need to specify the values for all                                related connection properties manually.</p> </li> <li> <p> <span>Repository</span>: The connection details stored                                centrally in <span><span>Repository</span><abbr> &gt; </abbr><span>Metadata</span></span> will be reused by this component. </p> <p>You need to click                                the <span>[...]</span> button next to it and in the pop-up                                    <span>Repository Content</span> dialog box, select the                                connection details to be reused, and all related connection                                properties will be automatically filled in.</p> </li> </ul><br><br>This property is not available when other connection component is selected from<br>the Connection Component dropdown list. |
| Component list | Select the component that opens the database connection to be reused by this<br>component. |
| Application Name | The application name required by Google Drive to get access to<br>its APIs. |
| OAuth Method | Select an OAuth method<br>used to access Google Drive from the drop-down list.<br><br><ul> <li> <p> <span>Installed Application (Id                                  &amp; Secret)</span>: uses the client ID and client secret                              created through Google API Console to access Google Drive. For more                              information about this method, see <a href="https://developers.google.com/identity/protocols/OAuth2#installed" target="_blank">Google Identity Platform &gt;                                  Installed applications </a>.</p> </li> <li> <p> <span>Installed Application                                  (JSON)</span>: uses the client secret JSON file that is                              created through Google API Console and contains the client ID,                              client secret, and other OAuth 2.0 parameters to access Google                              Drive.</p> </li> <li> <p> <span>Service                                  Account</span>: uses a service account JSON file created                              through Google API Console to access Google Drive. For more                              information about this method, see <a href="https://developers.google.com/identity/protocols/OAuth2#serviceaccount" target="_blank">Google Identity Platform &gt;                                  Service accounts</a>.</p> </li> </ul><br><br>For more information about how to access Google Drive using each method, see<br>[OAuth methods for accessing Google<br>Drive](https://help.qlik.com/talend/r/en-US/8.0/components/google-drive/oauth-methods-for-accessing-google-drive). |
| Client ID and<br>Client Secret | The client ID and client secret.<br><br>These two properties are available only when Installed Application (Id & Secret) is<br>selected from the OAuth Method<br>drop-down list. |
| Client Secret JSON | The path to the client secret JSON file.<br><br>This property is available only when Installed Application (JSON) is selected<br>from the OAuth Method drop-down<br>list. |
| Service Account<br>JSON | The path to the service account JSON file.<br><br>This property is available only when Service Account is selected from the<br>OAuth Method drop-down list. |
| Use Proxy | Select this check box when you are working behind a proxy.<br>With this check box selected, you need to specify the value for the<br>following parameters:<br><br><ul> <li> <p> <span>Host</span>: The IP                                address of the HTTP proxy server.</p> </li> <li> <p> <span>Port</span>: The port                                number of the HTTP proxy server.</p> </li> </ul> |
| Use SSL | Select this check box if an SSL connection is used to access<br>Google Drive. With this check box selected, you need to specify the value<br>for the following parameters:<br><br><ul> <li> <p> <span>Algorithm</span>: The                                name of the SSL cryptography algorithm.</p> </li> <li> <p> <span>Keystore File</span>:                                The path to the certificate TrustStore file that contains the list                                of certificates the client trusts.</p> </li> <li> <p> <span>Password</span>: The                                password used to check the integrity of the TrustStore data.</p> </li> </ul> |
| File | The name or ID of the file to be downloaded. |
| Access Method | Select the method by which the file to be downloaded is specified, either by Name or by Id. |
| Save as File | Select this check box to save the file to a local directory. In the Save to field displayed, browse to or enter the path where you want to save the file to be downloaded. |
| Schema and Edit schema | A schema is a row description, and<br>it defines the fields to be processed and passed on to the next component.<br><br>The schema of this component is read-only. You can click the [...] button next to Edit schema to view the predefined schema with only one field named content which describes the content of the file to be downloaded. |

## Advanced settings

| Properties | Description |
| --- | --- |
| DataStore Path | The path to<br>the credential file that stores the refresh token.<br><br>Information noteNote: When<br>your client ID, client secret, or any other configuration related to the<br>Installed Application authentication changes, you need to delete this<br>credential file manually before running your Job again.<br><br>This property is<br>available only when Installed Application (Id<br>& Secret) or Installed<br>Application (JSON) is selected from the OAuth Method drop-down list. |
| Read Timeout | Enter the read timeout value in seconds. An exception will<br>occur if the timeout expires before there is data available for read. The<br>default value is 30 and 0 means an<br>infinite time out. This option is available if the component does not use an<br>existing connection. |
| Include shared folders/files | Select this check box to take into account files and folders that have been<br>shared with you. |
| Include shared drives | Select this check box to take into account drives that have been shared with<br>you.<br><br>It is recommended to use the by Id Access Method in<br>Basic settings when you select this check box, as<br>using the by Name Access Method can affect<br>performance. |
| Corpora type | Select a type of Corpora to narrow the scope of file and folder searches:<br><br><ul> <li><span>User</span> to query files that you have accessed,                          including both shared drive and My Drive files.</li> <li><span>Drive</span> to query all items in the specified                          shared drive. Specify the drive ID in the <span>Drive                              ID</span> field.</li> <li><span>Domain</span> to query files that are shared to the                          domain, including both shared drive and My Drive files.</li> <li><span>All drives</span> to query files that you have                          accessed and all shared drives in which you are a member. This                          corpora type can affect performance as it has a broad scope.</li> </ul><br><br><br>By default, User is the selected value.<br><br>This property is available only when the Include shared<br>drives check box is selected. |
| Export Google Doc as | Select the type for the Google Doc to be exported. |
| Export Google Draw as | Select the type for the Google Draw to be exported. |
| Export Google Presentation as | Select the type for the Google Presentation to be exported. |
| Export Google Spreadsheet as | Select the type for the Google Spreadsheet to be exported. |
| Add extension | Select this check box to add extension to the exported file. |
| tStatCatcher Statistics | Select this checkbox to gather the Job processing metadata at the Job level<br>as well as at each component level. |

## Global Variables

| Variables | Description |
| --- | --- |
| ERROR\_MESSAGE | The error message generated by the component when an error<br>occurs. This is an After variable and it returns a string. |
| FILE\_ID | The ID of the file. This is an After variable and it returns<br>a string. |

## Usage

| Usage guidance | Description |
| --- | --- |
| Usage rule | This component can be used as a standalone component or as a start<br>component of a Job or subJob.<br><br>If you use this component as a standalone component:<br><br><ul> <li>When you select the <span>Save as File</span> checkbox, the                           file is saved to disk, and can be larger than 2 GB.</li> <li>When you leave the <span>Save as File</span> checkbox cleared,                           the file is cached in the memory, and cannot be larger than 2 GB                           otherwise you encounter the <span>OutOfMemoryError</span> error.</li> </ul><br><br>If you use this component as a start component of a Job or subJob:<br><br><ul> <li>When you select the <span>Save as File</span> checkbox, the                           file is cached in the memory first, then saved to disk, and streamed to                              <span>Talend Studio</span>. The file cannot be larger than 2 GB otherwise you encounter the                              <span>OutOfMemoryError</span> error.</li> <li>When you leave the <span>Save as File</span> checkbox cleared,                           the file is cached in the memory, and then streamed to <span>Talend Studio</span>. The file cannot be larger than 2 GB otherwise you encounter the                              <span>OutOfMemoryError</span> error.</li> </ul> |