public class ClientId extends Object
Corresponds to the information in the json file downloadable for a Client ID.
| Constructor and Description |
|---|
ClientId(String clientId,
String clientSecret)
Constructs a client ID using an explicit ID and secret
|
| Modifier and Type | Method and Description |
|---|---|
static ClientId |
fromJson(Map<String,Object> json)
Constructs a Client ID from JSON from a downloaded file.
|
static ClientId |
fromResource(Class<?> relativeClass,
String resourceName)
Constructs a Client ID from JSON file stored as a resource.
|
static ClientId |
fromStream(InputStream stream)
Constructs a Client ID from JSON file stream.
|
String |
getClientId()
Returns the text identifier of the Client ID.
|
String |
getClientSecret()
Returns the secret associated with the Client ID.
|
public ClientId(String clientId, String clientSecret)
Note: Direct use of this constructor in application code is not recommended to avoid having secrets or values that need to be updated in source code.
clientId - Text identifier of the Client ID.clientSecret - Secret to associated with the Client ID.public static ClientId fromJson(Map<String,Object> json) throws IOException
json - The JSON from the downloaded file.IOException - The JSON could not be parsed.public static ClientId fromResource(Class<?> relativeClass, String resourceName) throws IOException
relativeClass - A class in the same namespace as the resource.resourceName - The name of the resourceIOException - The JSON could not be loaded or parsed.public static ClientId fromStream(InputStream stream) throws IOException
stream - Stream of the downloaded JSON file.IOException - The JSON could not be read or parsed.public final String getClientId()
public final String getClientSecret()
Copyright © 2015 Google. All rights reserved.