File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
gcloud-java-datastore/src/main/java/com/google/gcloud/datastore
gcloud-java-storage/src/main/java/com/google/gcloud/storage Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 1717/**
1818 * A client to the Google Cloud Datastore.
1919 *
20- * <p>A simple usage example:
20+ * <p>Here's a simple usage example for using gcloud-java from App/Compute Engine :
2121 * <pre> {@code
22- * DatastoreOptions options = DatastoreOptions.builder().projectId(PROJECT_ID).build();
23- * Datastore datastore = options.service();
22+ * Datastore datastore = DatastoreOptions.defaultInstance().service();
2423 * KeyFactory keyFactory = datastore.newKeyFactory().kind(kind);
2524 * Key key = keyFactory.newKey(keyName);
2625 * Entity entity = datastore.get(key);
4746 * }
4847 * } </pre>
4948 *
49+ * <p>When using gcloud-java from outside of App/Compute Engine, you have to <a
50+ * href="https://github.com/GoogleCloudPlatform/gcloud-java#specifying-a-project-id">specify a
51+ * project ID</a> and
52+ * <a href="https://github.com/GoogleCloudPlatform/gcloud-java#authentication">provide
53+ * credentials</a>.
5054 * @see <a href="https://cloud.google.com/datastore/">Google Cloud Datastore</a>
5155 */
5256package com .google .gcloud .datastore ;
Original file line number Diff line number Diff line change 1717/**
1818 * A client to Google Cloud Storage.
1919 *
20- * <p>A simple usage example:
20+ * <p>Here's a simple usage example for using gcloud-java from App/Compute Engine :
2121 * <pre>{@code
22- * StorageOptions options = StorageOptions.builder().projectId("project").build();
23- * Storage storage = options.service();
22+ * Storage storage = StorageOptions.defaultInstance().service();
2423 * BlobId blobId = BlobId.of("bucket", "blob_name");
2524 * Blob blob = Blob.load(storage, blobId);
2625 * if (blob == null) {
3534 * channel.close();
3635 * }}</pre>
3736 *
37+ * When using gcloud-java from outside of App/Compute Engine, you have to <a
38+ * href="https://github.com/GoogleCloudPlatform/gcloud-java#specifying-a-project-id">specify a
39+ * project ID</a> and
40+ * <a href="https://github.com/GoogleCloudPlatform/gcloud-java#authentication">provide
41+ * credentials</a>.
3842 * @see <a href="https://cloud.google.com/storage/">Google Cloud Storage</a>
3943 */
4044package com .google .gcloud .storage ;
You can’t perform that action at this time.
0 commit comments