diff --git a/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/package-info.java b/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/package-info.java index 2135267d9ac4..1404b2817802 100644 --- a/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/package-info.java +++ b/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/package-info.java @@ -17,10 +17,9 @@ /** * A client to the Google Cloud Datastore. * - *
A simple usage example: + *
Here's a simple usage example for using gcloud-java from App/Compute Engine: *
{@code - * DatastoreOptions options = DatastoreOptions.builder().projectId(PROJECT_ID).build(); - * Datastore datastore = options.service(); + * Datastore datastore = DatastoreOptions.defaultInstance().service(); * KeyFactory keyFactory = datastore.newKeyFactory().kind(kind); * Key key = keyFactory.newKey(keyName); * Entity entity = datastore.get(key); @@ -47,6 +46,11 @@ * } * }* + *
When using gcloud-java from outside of App/Compute Engine, you have to specify a + * project ID and + * provide + * credentials. * @see Google Cloud Datastore */ package com.google.gcloud.datastore; diff --git a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/package-info.java b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/package-info.java index 2a09631be40a..137afd38b6ae 100644 --- a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/package-info.java +++ b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/package-info.java @@ -17,10 +17,9 @@ /** * A client to Google Cloud Storage. * - *
A simple usage example: + *
Here's a simple usage example for using gcloud-java from App/Compute Engine: *
{@code - * StorageOptions options = StorageOptions.builder().projectId("project").build(); - * Storage storage = options.service(); + * Storage storage = StorageOptions.defaultInstance().service(); * BlobId blobId = BlobId.of("bucket", "blob_name"); * Blob blob = Blob.load(storage, blobId); * if (blob == null) { @@ -35,6 +34,11 @@ * channel.close(); * }}* + * When using gcloud-java from outside of App/Compute Engine, you have to specify a + * project ID and + * provide + * credentials. * @see Google Cloud Storage */ package com.google.gcloud.storage;