Google Cloud Storage Java Programming Model: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 11: Line 11:
ServiceAccountCredentials serviceAccountCredentials;
ServiceAccountCredentials serviceAccountCredentials;
storageService.get(bucketName, options);
storageService.get(bucketName, options);
// or
storageService.get(bucketName);
</syntaxhighlight>
</syntaxhighlight>



Revision as of 19:02, 2 September 2021

Internal

Overview

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

Bucket by Name

ServiceAccountCredentials serviceAccountCredentials;
storageService.get(bucketName, options);
// or
storageService.get(bucketName);

List Buckets

Page<Bucket> buckets = storageService.list();