code: private static CredentialsProvider buildCredentialProvider(
        CredentialOptions credentialOptions) throws IOException {
      try {
        final Credentials credentials = CredentialFactory.getCredentials(credentialOptions);
        if (credentials == null) {
          LOG.info("Enabling the use of null credentials. This should not be used in production.");
          return NoCredentialsProvider.create();
        }
  
        return FixedCredentialsProvider.create(credentials);
      } catch (GeneralSecurityException exception) {
        throw new IOException("Could not initialize credentials.", exception);
      }
    }
docs: Creates {@link CredentialsProvider} based on {@link CredentialOptions}.