You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[`BigQueryExample`](./gcloud-java-examples/src/main/java/com/google/cloud/examples/bigquery/BigQueryExample.java) - A simple command line interface providing some of Cloud BigQuery's functionality
52
53
- Read more about using this application on the [`BigQueryExample` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/cloud/examples/bigquery/BigQueryExample.html).
54
+
-[`ComputeExample`](./gcloud-java-examples/src/main/java/com/google/cloud/examples/compute/ComputeExample.java) - A simple command line interface providing some of Cloud Compute's functionality
55
+
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/cloud/examples/compute/ComputeExample.html).
53
56
-[`Bookshelf`](https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/bookshelf) - An App Engine app that manages a virtual bookshelf.
54
57
- This app uses `gcloud-java` to interface with Cloud Datastore and Cloud Storage. It also uses Cloud SQL, another Google Cloud Platform service.
55
58
-[`DatastoreExample`](./gcloud-java-examples/src/main/java/com/google/cloud/examples/datastore/DatastoreExample.java) - A simple command line interface for Cloud Datastore
@@ -104,7 +107,7 @@ First, ensure that the necessary Google Cloud APIs are enabled for your project.
104
107
Next, choose a method for authenticating API requests from within your project:
105
108
106
109
1. When using `gcloud-java` libraries from within Compute/App Engine, no additional authentication steps are necessary.
107
-
2. When using `gcloud-java` libraries elsewhere, there are two options:
110
+
2. When using `gcloud-java` libraries elsewhere, there are three options:
108
111
*[Generate a JSON service account key](https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts). After downloading that key, you must do one of the following:
109
112
* Define the environment variable GOOGLE_APPLICATION_CREDENTIALS to be the location of the key. For example:
110
113
```bash
@@ -113,11 +116,18 @@ Next, choose a method for authenticating API requests from within your project:
113
116
* Supply the JSON credentials file when building the service options. For example, this Storage object has the necessary permissions to interact with your Google Cloud Storage data:
* If running locally fordevelopment/testing, you can use Google Cloud SDK. Download the SDK if you haven't already, then login using the SDK (`gcloud auth login`incommand line). Be sure to set your project ID as described above.
124
+
* If you already have an OAuth2 access token, you can use it to authenticate (notice that in this case the access token will not be automatically refreshed):
* If running locally fordevelopment/testing, you can use use Google Cloud SDK. Download the SDK if you haven't already, then login using the SDK (`gcloud auth login`incommand line). Be sure to set your project ID as described above.
130
+
```
121
131
122
132
`gcloud-java` looks forcredentialsin the following order, stopping once it finds credentials:
123
133
@@ -163,16 +173,79 @@ if (table == null) {
163
173
}
164
174
System.out.println("Loading data into table " + tableId);
0 commit comments