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 BuildsGoogleCredentialsusing the provided credentials path and credentials JSON.credentialsPathandcredentialsJsonare mutually exclusive. So if both are provided (are non-null), this is an error.If either
credentialsPathorcredentialsJsonis 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
GoogleCredentialsconstructed based on the input. - Throws:
IOException- if some error getting the credentials happen.IllegalArgumentException- if bothcredentialsPathandcredentialsJsonare non-null.
-