Package io.aiven.kafka.connect.gcs
Class GoogleCredentialsBuilder
java.lang.Object
io.aiven.kafka.connect.gcs.GoogleCredentialsBuilder
-
Method Summary
-
Method Details
-
build
public static com.google.auth.oauth2.GoogleCredentials build(String credentialsPath, String credentialsJson) throws IOException BuildsGoogleCredentials
using the provided credentials path and credentials JSON.credentialsPath
andcredentialsJson
are mutually exclusive. So if both are provided (are non-null
), this is an error.If either
credentialsPath
orcredentialsJson
is provided, it's used to construct the credentials.If none are provided, the default GCP SDK credentials acquisition mechanism is used.
- Parameters:
credentialsPath
- the credential path, can benull
.credentialsJson
- the credential JSON string, can benull
.- Returns:
- a
GoogleCredentials
constructed based on the input. - Throws:
IOException
- if some error getting the credentials happen.IllegalArgumentException
- if bothcredentialsPath
andcredentialsJson
are non-null
.
-