public class PropertiesCredentials extends java.lang.Object implements AWSCredentials
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
accessKey |
private java.lang.String |
secretAccessKey |
Constructor and Description |
---|
PropertiesCredentials(java.io.File file)
Reads the specified file as a Java properties file and extracts the
AWS access key from the "accessKey" property and AWS secret access
key from the "secretKey" property.
|
PropertiesCredentials(java.io.InputStream inputStream)
Reads the specified input stream as a stream of Java properties file
content and extracts the AWS access key ID and secret access key from the
properties.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAWSAccessKeyId()
Returns the AWS access key ID for this credentials object.
|
java.lang.String |
getAWSSecretKey()
Returns the AWS secret access key for this credentials object.
|
private final java.lang.String accessKey
private final java.lang.String secretAccessKey
public PropertiesCredentials(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException, java.lang.IllegalArgumentException
file
- The file from which to read the AWS credentials
properties.java.io.FileNotFoundException
- If the specified file isn't found.java.io.IOException
- If any problems are encountered reading the AWS access
keys from the specified file.java.lang.IllegalArgumentException
- If the specified properties file does not contain the
required keys.public PropertiesCredentials(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- The input stream containing the AWS credential properties.java.io.IOException
- If any problems occur while reading from the input stream.public java.lang.String getAWSAccessKeyId()
AWSCredentials
getAWSAccessKeyId
in interface AWSCredentials
public java.lang.String getAWSSecretKey()
AWSCredentials
getAWSSecretKey
in interface AWSCredentials