

Private static final String TOKENS_DIRECTORY_PATH = "tokens" * Directory to store authorization tokens for this application. Private static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance() Private static final String APPLICATION_NAME = "Google Drive API Java Quickstart" * class to demonstarte use of Drive files list API */ Open the default adle file and replace its contents with the In the src/main/resources/ directory, copy the credentials.json file Mkdir -p src/main/java src/main/resources In your working directory, create a new project structure: gradle init -type basic

Save the downloaded JSON file as credentials.json, and move the.The newly created credential appears under OAuth 2.0 Client IDs. The OAuth client created screen appears, showing your new Client ID and Client secret. This name is only shown in the Google Cloud console. In the Name field, type a name for the credential.Click Create Credentials > OAuth client ID.In the Google Cloud console, go to Menu menu > APIs & Services > Credentials.

You must create a separate client ID for each platform. To authenticate as an end user and access user data in your app, you need toĬreate one or more OAuth 2.0 Client IDs. In the Google Cloud console, enable the Drive API.Īuthorize credentials for a desktop application You can enable one or more APIs in a single Google Cloud project. Enable the APIīefore using Google APIs, you need to enable them in a Google Cloud project. To complete this quickstart, set up your environment.
