File tree Expand file tree Collapse file tree
gcloud-java-storage/src/main/java/com/google/gcloud/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- refs/heads/master: fb2580410520a66b51e26ff791fdc5b5685f1035
2+ refs/heads/master: 32e75217e0bd703c74c0a5b2d90dfc51b15acd02
33refs/heads/travis: 0fa997e2fc9c6b61b2d91e6d163655aae67d44b6
44refs/heads/gh-pages: 5a10432ecc75f29812e33a8236c900379509fe99
Original file line number Diff line number Diff line change @@ -112,7 +112,8 @@ import java.nio.ByteBuffer;
112112import java.nio.channels.WritableByteChannel ;
113113
114114Storage 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());
116117if (! blob. exists()) {
117118 storage2. create(blob. info(), " Hello, Cloud Storage!" . getBytes(UTF_8 ));
118119} else {
Original file line number Diff line number Diff line change 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 {
You can’t perform that action at this time.
0 commit comments