Class B2CredentialsFromEnvironmentSource
- java.lang.Object
-
- com.backblaze.b2.client.credentialsSources.B2CredentialsFromEnvironmentSource
-
- All Implemented Interfaces:
B2CredentialsSource
public class B2CredentialsFromEnvironmentSource extends java.lang.Object implements B2CredentialsSource
This B2CredentialsSource reads the credentials from two environment variables: B2_APPLICATION_KEY_ID B2_APPLICATION_KEY If either is missing or empty, getCredentials() will throw.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static B2CredentialsSource
build()
boolean
canGetCredentials()
B2Credentials
getCredentials()
-
-
-
Method Detail
-
getCredentials
public B2Credentials getCredentials()
- Specified by:
getCredentials
in interfaceB2CredentialsSource
- Returns:
- the credentials specified in the environment.
- Throws:
java.lang.IllegalStateException
- if any of the required environment variables are missing.
-
build
public static B2CredentialsSource build()
-
canGetCredentials
public boolean canGetCredentials()
- Returns:
- true iff we can create credentials from the environment.
-
-