Skip to content

Commit 32e7521

Browse files
committed
Update Storage example in README.md and package-info
1 parent fb25804 commit 32e7521

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ import java.nio.ByteBuffer;
112112
import java.nio.channels.WritableByteChannel;
113113

114114
Storage storage = StorageFactory.instance().get(StorageOptions.getDefaultInstance());
115-
Blob blob = new Blob(storage, "bucket", "blob_name");
115+
Blob blob = new Blob(storage,
116+
BlobInfo.builder("bucket", "blob_name").contentType("text/plain").build());
116117
if (!blob.exists()) {
117118
storage2.create(blob.info(), "Hello, Cloud Storage!".getBytes(UTF_8));
118119
} else {

gcloud-java-storage/src/main/java/com/google/gcloud/storage/package-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
* <pre>{@code
2222
* StorageOptions options = StorageOptions.builder().projectId("project").build();
2323
* Storage storage = StorageFactory.instance().get(options);
24-
* Blob blob = new Blob(storage, "bucket", "blob_name");
24+
* Blob blob = new Blob(storage,
25+
* BlobInfo.builder("bucket", "blob_name").contentType("text/plain").build());
2526
* if (!blob.exists()) {
2627
* storage.create(blob.info(), "Hello, Cloud Storage!".getBytes(UTF_8));
2728
* } else {

0 commit comments

Comments
 (0)