Skip to content

Commit

Permalink
docs: Fix broken links in readme (#1520)
Browse files Browse the repository at this point in the history
* 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 <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Alice <65933803+alicejli@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 10, 2022
1 parent b27008b commit 840b08a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 34 deletions.
17 changes: 4 additions & 13 deletions .readme-partials.yaml
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
17 changes: 4 additions & 13 deletions README.md
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
Expand Up @@ -17,10 +17,8 @@
/**
* A client for Cloud Storage - Unified object storage.
*
* <p>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 <a
* href="https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/GetOrCreateBlob.java">
* CreateBlob.java</a>.
* <p>Here's a simple usage example the Java Storage client. This example shows how to create a
* Storage object.
*
* <pre>{@code
* Storage storage = StorageOptions.getDefaultInstance().getService();
Expand All @@ -29,10 +27,7 @@
* Blob blob = storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));
* }</pre>
*
* <p>This second example shows how to update the blob's content if the blob exists. For the
* complete source code see <a
* href="https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/UpdateBlob.java">
* UpdateBlob.java</a>.
* <p>This second example shows how to update an object's content if the object exists.
*
* <pre>{@code
* Storage storage = StorageOptions.getDefaultInstance().getService();
Expand All @@ -47,6 +42,9 @@
* }
* }</pre>
*
* <p>For more detailed code examples, see the <a
* href="https://cloud.google.com/storage/docs/samples">sample library</a>.
*
* <p>When using google-cloud from outside of App/Compute Engine, you have to <a
* href="https://github.com/googleapis/google-cloud-java#specifying-a-project-id">specify a project
* ID</a> and <a href="https://github.com/googleapis/google-cloud-java#authentication">provide
Expand Down

0 comments on commit 840b08a

Please sign in to comment.