Skip to content

Commit 64f6ef5

Browse files
committed
formatting fix
1 parent e34c14d commit 64f6ef5

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

auth/src/main/java/com/google/cloud/auth/samples/AuthExample.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,18 @@
2020
import com.google.auth.appengine.AppEngineCredentials;
2121
import com.google.auth.oauth2.ComputeEngineCredentials;
2222
import com.google.auth.oauth2.GoogleCredentials;
23+
import com.google.cloud.language.v2.AnalyzeSentimentResponse;
24+
import com.google.cloud.language.v2.Document;
25+
import com.google.cloud.language.v2.LanguageServiceClient;
26+
import com.google.cloud.language.v2.LanguageServiceSettings;
2327
import com.google.cloud.storage.Bucket;
2428
import com.google.cloud.storage.Storage;
2529
import com.google.cloud.storage.StorageOptions;
2630
import com.google.common.collect.Lists;
2731
import java.io.FileInputStream;
2832
import java.io.IOException;
29-
import com.google.cloud.language.v2.AnalyzeSentimentResponse;
30-
import com.google.cloud.language.v2.Document;
31-
import com.google.cloud.language.v2.LanguageServiceClient;
32-
import com.google.cloud.language.v2.LanguageServiceSettings;
3333

34-
/**
35-
* Demonstrate various ways to authenticate requests using Cloud Storage as an example call.
36-
*/
34+
/** Demonstrate various ways to authenticate requests using Cloud Storage as an example call. */
3735
public class AuthExample {
3836
// [START auth_cloud_implicit]
3937
static void authImplicit() {
@@ -53,8 +51,9 @@ static void authImplicit() {
5351
static void authExplicit(String jsonPath) throws IOException {
5452
// You can specify a credential file by providing a path to GoogleCredentials.
5553
// Otherwise credentials are read from the GOOGLE_APPLICATION_CREDENTIALS environment variable.
56-
GoogleCredentials credentials = GoogleCredentials.fromStream(new FileInputStream(jsonPath))
57-
.createScoped(Lists.newArrayList("https://www.googleapis.com/auth/cloud-platform"));
54+
GoogleCredentials credentials =
55+
GoogleCredentials.fromStream(new FileInputStream(jsonPath))
56+
.createScoped(Lists.newArrayList("https://www.googleapis.com/auth/cloud-platform"));
5857
Storage storage = StorageOptions.newBuilder().setCredentials(credentials).build().getService();
5958

6059
System.out.println("Buckets:");
@@ -130,13 +129,13 @@ public static void main(String[] args) throws IOException {
130129
return;
131130
}
132131
if ("apikey".equals(args[0])) {
133-
if (args.length >= 2) {
134-
authApiKey(args[1]);
135-
} else {
136-
throw new IllegalArgumentException("Api key is required with 'apikey'.");
137-
}
138-
return;
132+
if (args.length >= 2) {
133+
authApiKey(args[1]);
134+
} else {
135+
throw new IllegalArgumentException("Api key is required with 'apikey'.");
139136
}
137+
return;
138+
}
140139

141140
authImplicit();
142141
}

0 commit comments

Comments
 (0)