Class 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 Detail

      • getCredentials

        public B2Credentials getCredentials()
        Specified by:
        getCredentials in interface B2CredentialsSource
        Returns:
        the credentials specified in the environment.
        Throws:
        java.lang.IllegalStateException - if any of the required environment variables are missing.
      • canGetCredentials

        public boolean canGetCredentials()
        Returns:
        true iff we can create credentials from the environment.