public class AWSConfiguration extends 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,
String configName)
Construct an AWSConfiguration object
|
Modifier and Type | Method and Description |
---|---|
String |
getConfiguration() |
String |
getUserAgent() |
org.json.JSONObject |
optJsonObject(String key)
This method will search for the name provided in the json and unwrap the
configuration specified by
setConfiguration(String) . |
void |
setConfiguration(String configurationName)
Change the settings that are being read in.
|
String |
toString() |
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, 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(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 String getUserAgent()
public void setConfiguration(String configurationName)
configurationName
- the key used to differentiate between configuration settingspublic String getConfiguration()
Copyright © 2018. All rights reserved.