File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
java-core/google-cloud-core/src/main/java/com/google/cloud Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -327,7 +327,11 @@ protected ServiceOptions(
327
327
quotaProjectId =
328
328
builder .quotaProjectId != null
329
329
? builder .quotaProjectId
330
- : getValueFromCredentialsFile (System .getenv (CREDENTIAL_ENV_NAME ), "quota_project_id" );
330
+ : getValueFromCredentialsFile (getCredentialsPath (), "quota_project_id" );
331
+ }
332
+
333
+ private static String getCredentialsPath () {
334
+ return System .getProperty (CREDENTIAL_ENV_NAME , System .getenv (CREDENTIAL_ENV_NAME ));
331
335
}
332
336
333
337
/**
@@ -511,7 +515,7 @@ static boolean headerContainsMetadataFlavor(HttpResponse response) {
511
515
}
512
516
513
517
protected static String getServiceAccountProjectId () {
514
- return getValueFromCredentialsFile (System . getenv ( CREDENTIAL_ENV_NAME ), "project_id" );
518
+ return getValueFromCredentialsFile (getCredentialsPath ( ), "project_id" );
515
519
}
516
520
517
521
@ InternalApi ("Visible for testing" )
You can’t perform that action at this time.
0 commit comments