File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -101,9 +101,9 @@ String bucketName = "my_unique_bucket"; // Change this to something unique
101101Bucket bucket = storage. create(BucketInfo . of(bucketName));
102102
103103// Upload a blob to the newly created bucket
104- BlobId blobId = BlobId . of(bucketName , " my_blob_name " );
105- Blob blob = storage . create(
106- " my_blob_name " , " a simple blob " . getBytes(UTF_8 ), " text/plain " );
104+ BlobId blobId = BlobId . of(" bucket " , " blob_name " );
105+ BlobInfo blobInfo = BlobInfo . builder(blobId) . contentType( " text/plain " ) . build();
106+ Blob blob = storage . create(blobInfo, " Hello, Cloud Storage! " . getBytes(UTF_8 ));
107107```
108108
109109At this point, you will be able to see your newly created bucket and blob on the Google Developers Console.
You can’t perform that action at this time.
0 commit comments