Google Cloud Storage Java Programming Model: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Google Cloud Programmatic Access")
 
Line 1: Line 1:
=Internal=
=Internal=
* [[Google Cloud Programmatic Access#Subjects|Google Cloud Programmatic Access]]
* [[Google Cloud Programmatic Access#Subjects|Google Cloud Programmatic Access]]
=Overview=
<syntaxhighlight lang='java'>
ServiceAccountCredentials serviceAccountCredentials;
Storage storageService = StorageOptions.newBuilder().setCredentials(serviceAccountCredentials).build().getService();
// bucket by name
storageService.get(bucketName, options);
// list buckets
Page<Bucket> buckets = storageService.list();
</syntaxhighlight>

Revision as of 18:56, 2 September 2021

Internal

Overview

ServiceAccountCredentials serviceAccountCredentials;
Storage storageService = StorageOptions.newBuilder().setCredentials(serviceAccountCredentials).build().getService();

// bucket by name
storageService.get(bucketName, options);
// list buckets
Page<Bucket> buckets = storageService.list();