public static class GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder extends Object implements Builder<com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets>
GoogleClientSecrets
.DEFAULT_CONFIGURATION_FILENAME
Modifier and Type | Method and Description |
---|---|
com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets |
build()
Constructs this object.
|
GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder |
from(org.apache.commons.configuration.Configuration config)
Reads properties from the provided
Configuration object
Understands the following properties suffixes: clientId clientSecret For example, the AdWords OAuth2 client ID can be read from: api.adwords.clientId |
GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder |
fromFile()
Loads credentials from the "ads.properties" file in one of the
following locations according to the following order: in the current directory, in
the user home directory, in the classpath
|
GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder |
fromFile(File path)
Populates this builder from a properties file from a specified path.
|
GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder |
fromFile(String path)
Populates this builder from a properties file from a specified path.
|
GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder |
fromFile(URL path)
Populates this builder from a properties file from a specified path.
|
GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder |
withClientSecrets(String clientId,
String clientSecret)
Sets the client ID & secret to create the OAuth2 Credential with.
|
public GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder withClientSecrets(String clientId, String clientSecret)
public com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets build() throws ValidationException
Builder
build
in interface Builder<com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets>
ValidationException
- if the provided data is not valid.public GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder from(org.apache.commons.configuration.Configuration config)
Configuration
object
api.adwords.clientId
public GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder fromFile(String path) throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
Builder
fromFile
in interface Builder<com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets>
path
- the path to try first as a resource, then as a filecom.google.api.ads.common.lib.conf.ConfigurationLoadException
- if the configuration could not be
loaded.public GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder fromFile(File path) throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
Builder
fromFile
in interface Builder<com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets>
path
- the path to load properties fromcom.google.api.ads.common.lib.conf.ConfigurationLoadException
- if the configuration could not be
loaded.public GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder fromFile(URL path) throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
Builder
fromFile
in interface Builder<com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets>
path
- the path to try first as a resource, then as a filecom.google.api.ads.common.lib.conf.ConfigurationLoadException
- if the configuration could not be
loaded.public GoogleClientSecretsBuilder.GoogleClientSecretsForApiBuilder fromFile() throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
Builder
Copyright © 2018. All Rights Reserved.