public class AWSConfiguration
extends java.lang.Object
Constructor and Description |
---|
AWSConfiguration(android.content.Context context)
Constructs an AWSConfiguration object
|
AWSConfiguration(android.content.Context context,
int configResourceId)
Constructs an AWSConfiguration object
|
AWSConfiguration(android.content.Context context,
int configResourceId,
java.lang.String configName)
Construct an AWSConfiguration object
|
AWSConfiguration(org.json.JSONObject jsonObject)
Construct an AWSConfiguration object based on the JSONObject passed in.
|
AWSConfiguration(org.json.JSONObject jsonObject,
java.lang.String configName)
Construct an AWSConfiguration object based on the JSONObject passed in.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getConfiguration() |
java.lang.String |
getUserAgent() |
java.lang.String |
getUserAgentOverride()
The user agent is sometimes combined with other strings.
|
org.json.JSONObject |
optJsonObject(java.lang.String key)
This method will search for the name provided in the json and unwrap the
configuration specified by
setConfiguration(String) . |
void |
setConfiguration(java.lang.String configurationName)
Change the settings that are being read in.
|
java.lang.String |
toString() |
public AWSConfiguration(org.json.JSONObject jsonObject)
jsonObject
- contains the configuration informationpublic AWSConfiguration(org.json.JSONObject jsonObject, java.lang.String configName)
jsonObject
- contains the configuration informationconfigName
- name of the configuration,
"Default" or something else like "Backup"public AWSConfiguration(android.content.Context context)
context
- application context, used to retrieve
awsconfiguration.json from resourcespublic AWSConfiguration(android.content.Context context, int configResourceId)
context
- application context, used to retrieve the resource
specified by configResourceIdconfigResourceId
- resource id of the json file to be readpublic AWSConfiguration(android.content.Context context, int configResourceId, java.lang.String configName)
context
- application context, used to retrieve the resource
specified by configResourceIdconfigResourceId
- resource id of the json file to be readconfigName
- instructs the reader of this configuration to pick the
specified configNamepublic org.json.JSONObject optJsonObject(java.lang.String key)
setConfiguration(String)
.
Example:
{
"S3TransferUtility": {
"Default": {
"Bucket": "waterBucket",
"Region": "us-west-2"
}
}
}
When name is "S3TransferUtility" and setConfiguration is "Default",
The value return is:
{
"Bucket": "waterBucket",
"Region": "us-west-2"
}
Certain keys do not have a configuration (i.e. "Default") and
when this happens the value for the key is directly returned.key
- used to search for in JSON mapname
if it
exists and is a JSONObject
, or null otherwise.public java.lang.String getUserAgent()
public java.lang.String getUserAgentOverride()
public void setConfiguration(java.lang.String configurationName)
configurationName
- the key used to differentiate between configuration settingspublic java.lang.String getConfiguration()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.