From 840b08a03fa7c0535855140244c282f79403b458 Mon Sep 17 00:00:00 2001 From: JesseLovelace <43148100+JesseLovelace@users.noreply.github.com> Date: Wed, 10 Aug 2022 13:14:10 -0700 Subject: [PATCH] docs: Fix broken links in readme (#1520) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix broken links in README * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update partials yaml * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix javadoc * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Alice <65933803+alicejli@users.noreply.github.com> --- .readme-partials.yaml | 17 ++++------------- README.md | 17 ++++------------- .../com/google/cloud/storage/package-info.java | 14 ++++++-------- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/.readme-partials.yaml b/.readme-partials.yaml index 792c7985a..c95759f5b 100644 --- a/.readme-partials.yaml +++ b/.readme-partials.yaml @@ -14,7 +14,7 @@ custom_content: | Storage storage = StorageOptions.getDefaultInstance().getService(); ``` - For other authentication options, see the [Authentication](https://github.com/googleapis/google-cloud-java#authentication) page. + For other authentication options, see the [Authentication](https://github.com/googleapis/google-cloud-java#authentication) page in Google Cloud Java. #### Storing data Stored objects are called "blobs" in `google-cloud` and are organized into containers called "buckets". `Blob`, a @@ -51,7 +51,7 @@ custom_content: | ``` A complete example for creating a blob can be found at - [CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). + [UploadObject.java](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/UploadObject.java). At this point, you will be able to see your newly created bucket and blob on the Google Developers Console. @@ -66,7 +66,7 @@ custom_content: | ``` A complete example for accessing blobs can be found at - [CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). + [DownloadObject.java](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java). #### Updating data Another thing we may want to do is update a blob. The following snippet shows how to update a Storage blob if it exists. @@ -83,9 +83,6 @@ custom_content: | } ``` - The complete source code can be found at - [UpdateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/UpdateBlob.java). - #### Listing buckets and contents of buckets Suppose that you've added more buckets and blobs, and now you want to see the names of your buckets and the contents of each one. Add the following code to list all your buckets and all the blobs inside each bucket. @@ -106,16 +103,10 @@ custom_content: | #### Complete source code - In - [CreateAndListBucketsAndBlobs.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateAndListBucketsAndBlobs.java) - we put together examples creating and listing buckets and blobs into one program. The program assumes that you are - running on Compute Engine or from your own desktop. To run the example on App Engine, simply move - the code from the main method to your application's servlet class and change the print statements to - display on your webpage. + See [ListObjects.java](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/ListObjects.java) for a complete example. ### Example Applications - - [`StorageExample`](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java) is a simple command line interface that provides some of Cloud Storage's functionality. Read more about using the application on the [`StorageExample` docs page](https://github.com/googleapis/google-cloud-java/blob/main/google-cloud-examples/README.md). - [`Bookshelf`](https://github.com/GoogleCloudPlatform/getting-started-java/tree/main/bookshelf) - An App Engine application that manages a virtual bookshelf. - This app uses `google-cloud` to interface with Cloud Datastore and Cloud Storage. It also uses Cloud SQL, another Google Cloud Platform service. - [`Flexible Environment/Storage example`](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/main/flexible/cloudstorage) - An app that uploads files to a public Cloud Storage bucket on the App Engine Flexible Environment runtime. diff --git a/README.md b/README.md index 4efd58f5d..05ffac31e 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ import com.google.cloud.storage.StorageOptions; Storage storage = StorageOptions.getDefaultInstance().getService(); ``` -For other authentication options, see the [Authentication](https://github.com/googleapis/google-cloud-java#authentication) page. +For other authentication options, see the [Authentication](https://github.com/googleapis/google-cloud-java#authentication) page in Google Cloud Java. #### Storing data Stored objects are called "blobs" in `google-cloud` and are organized into containers called "buckets". `Blob`, a @@ -149,7 +149,7 @@ Blob blob = storage.create(blobInfo, "a simple blob".getBytes(UTF_8)); ``` A complete example for creating a blob can be found at -[CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). +[UploadObject.java](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/UploadObject.java). At this point, you will be able to see your newly created bucket and blob on the Google Developers Console. @@ -164,7 +164,7 @@ String contentString = new String(content, UTF_8); ``` A complete example for accessing blobs can be found at -[CreateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateBlob.java). +[DownloadObject.java](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java). #### Updating data Another thing we may want to do is update a blob. The following snippet shows how to update a Storage blob if it exists. @@ -181,9 +181,6 @@ if (blob != null) { } ``` -The complete source code can be found at -[UpdateBlob.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/UpdateBlob.java). - #### Listing buckets and contents of buckets Suppose that you've added more buckets and blobs, and now you want to see the names of your buckets and the contents of each one. Add the following code to list all your buckets and all the blobs inside each bucket. @@ -204,16 +201,10 @@ for (Bucket bucket : storage.list().iterateAll()) { #### Complete source code -In -[CreateAndListBucketsAndBlobs.java](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/CreateAndListBucketsAndBlobs.java) -we put together examples creating and listing buckets and blobs into one program. The program assumes that you are -running on Compute Engine or from your own desktop. To run the example on App Engine, simply move -the code from the main method to your application's servlet class and change the print statements to -display on your webpage. +See [ListObjects.java](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/ListObjects.java) for a complete example. ### Example Applications -- [`StorageExample`](https://github.com/googleapis/google-cloud-java/tree/main/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/StorageExample.java) is a simple command line interface that provides some of Cloud Storage's functionality. Read more about using the application on the [`StorageExample` docs page](https://github.com/googleapis/google-cloud-java/blob/main/google-cloud-examples/README.md). - [`Bookshelf`](https://github.com/GoogleCloudPlatform/getting-started-java/tree/main/bookshelf) - An App Engine application that manages a virtual bookshelf. - This app uses `google-cloud` to interface with Cloud Datastore and Cloud Storage. It also uses Cloud SQL, another Google Cloud Platform service. - [`Flexible Environment/Storage example`](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/main/flexible/cloudstorage) - An app that uploads files to a public Cloud Storage bucket on the App Engine Flexible Environment runtime. diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/package-info.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/package-info.java index ace8f6611..1c17ee701 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/package-info.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/package-info.java @@ -17,10 +17,8 @@ /** * A client for Cloud Storage - Unified object storage. * - *

Here's a simple usage example for using google-cloud from App/Compute Engine. This example - * shows how to create a Storage blob. For the complete source code see - * CreateBlob.java. + *

Here's a simple usage example the Java Storage client. This example shows how to create a + * Storage object. * *

{@code
  * Storage storage = StorageOptions.getDefaultInstance().getService();
@@ -29,10 +27,7 @@
  * Blob blob = storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));
  * }
* - *

This second example shows how to update the blob's content if the blob exists. For the - * complete source code see - * UpdateBlob.java. + *

This second example shows how to update an object's content if the object exists. * *

{@code
  * Storage storage = StorageOptions.getDefaultInstance().getService();
@@ -47,6 +42,9 @@
  * }
  * }
* + *

For more detailed code examples, see the sample library. + * *

When using google-cloud from outside of App/Compute Engine, you have to specify a project * ID and provide