File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
auth/src/main/java/com/google/cloud/auth/samples Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 3131import java .io .FileInputStream ;
3232import java .io .IOException ;
3333
34- /** Demonstrate various ways to authenticate requests using Cloud Storage/Language APIs as
35- * examples.
34+ /**
35+ * Demonstrate various ways to authenticate requests using Cloud Storage/Language APIs as examples.
3636 */
3737public class AuthExample {
3838 // [START auth_cloud_implicit]
@@ -53,9 +53,8 @@ static void authImplicit() {
5353 static void authExplicit (String jsonPath ) throws IOException {
5454 // You can specify a credential file by providing a path to GoogleCredentials.
5555 // Otherwise credentials are read from the GOOGLE_APPLICATION_CREDENTIALS environment variable.
56- GoogleCredentials credentials =
57- GoogleCredentials .fromStream (new FileInputStream (jsonPath ))
58- .createScoped (Lists .newArrayList ("https://www.googleapis.com/auth/cloud-platform" ));
56+ GoogleCredentials credentials = GoogleCredentials .fromStream (new FileInputStream (jsonPath ))
57+ .createScoped (Lists .newArrayList ("https://www.googleapis.com/auth/cloud-platform" ));
5958 Storage storage = StorageOptions .newBuilder ().setCredentials (credentials ).build ().getService ();
6059
6160 System .out .println ("Buckets:" );
You can’t perform that action at this time.
0 commit comments