1- Google Cloud Java Client for Storage
2- ====================================
1+ Google Cloud Java Client
2+ ==========================
33
4- Java idiomatic client for [ Google Cloud Storage ] ( https:// cloud.google.com/storage/ ).
4+ Java idiomatic client for [ Google Cloud Platform ] [ cloud-platform ] services.
55
66[ ![ Build Status] ( https://travis-ci.org/GoogleCloudPlatform/gcloud-java.svg?branch=master )] ( https://travis-ci.org/GoogleCloudPlatform/gcloud-java )
77[ ![ Coverage Status] ( https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master )] ( https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master )
88
99- [ Homepage] (https://googlecloudplatform.github.io/gcloud-java/ )
10- - [ API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/storage/package-summary.html )
10+ - [ API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs )
1111- [ Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html )
1212
13+ This client supports the [ Google Cloud Storage] (https://cloud.google.com/storage/ )
14+
1315> Note: This client is a work-in-progress, and may occasionally
1416> make backwards-incompatible changes.
1517
@@ -24,46 +26,6 @@ Add this to your pom.xml file
2426</dependency >
2527```
2628
27- Google Cloud Storage
28- ----------------------
29-
30- [ Google Cloud Storage] [ cloud-storage ] is a durable and highly available
31- object storage service. Google Cloud Storage is almost infinitely scalable
32- and guarantees consistency: when a write succeeds, the latest copy of the
33- object will be returned to any GET, globally.
34-
35- See the [ Google Cloud Storage docs] [ cloud-storage-activation ] for more details on how to activate
36- Cloud Storage for your project.
37-
38- See the `` gcloud-java `` API [ storage documentation] [ storage-api ] to learn how to interact
39- with the Cloud Storage using this Client Library.
40-
41- ``` java
42- import static java.nio.charset.StandardCharsets.UTF_8 ;
43-
44- import com.google.gcloud.storage.Blob ;
45- import com.google.gcloud.storage.Storage ;
46- import com.google.gcloud.storage.StorageFactory ;
47- import com.google.gcloud.storage.StorageOptions ;
48-
49- import java.nio.ByteBuffer ;
50- import java.nio.channels.WritableByteChannel ;
51-
52- StorageOptions options = StorageOptions . builder(). projectId(PROJECT_ID ). build();
53- Storage storage = StorageFactory . instance(). get(options);
54- Blob blob = new Blob (storage, " bucket" , " blob_name" );
55- if (! blob. exists()) {
56- storage2. create(blob. info(), " Hello, Cloud Storage!" . getBytes(UTF_8 ));
57- } else {
58- System . out. println(" Updating content for " + blob. info(). name());
59- byte [] prevContent = blob. content();
60- System . out. println(new String (prevContent, UTF_8 ));
61- WritableByteChannel channel = blob. writer();
62- channel. write(ByteBuffer . wrap(" Updated content" . getBytes(UTF_8 )));
63- channel. close();
64- }
65- ```
66-
6729Testing
6830-------
6931
@@ -106,4 +68,3 @@ Apache 2.0 - See [LICENSE] for more information.
10668[ cloud-storage ] : https://cloud.google.com/storage/
10769[ cloud-storage-docs ] : https://cloud.google.com/storage/docs/overview
10870[ cloud-storage-create-bucket ] : https://cloud.google.com/storage/docs/cloud-console#_creatingbuckets
109- [ storage-api ] : http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/storage/package-summary.html
0 commit comments