com.netease.cloud.auth
public class PropertiesCredentials extends Object implements Credentials
Constructor and Description |
---|
PropertiesCredentials(File file)
Reads the specified file as a Java properties file and extracts the
access key from the "accessKey" property and secret access key from the
"secretKey" property.
|
PropertiesCredentials(InputStream inputStream)
Reads the specified input stream as a stream of Java properties file
content and extracts the access key ID and secret access key from the
properties.
|
Modifier and Type | Method and Description |
---|---|
String |
getAccessKeyId()
Returns the access key ID for this credentials object.
|
String |
getSecretKey()
Returns the secret access key for this credentials object.
|
public PropertiesCredentials(File file) throws FileNotFoundException, IOException, IllegalArgumentException
file
- The file from which to read the credentials properties.FileNotFoundException
- If the specified file isn't found.IOException
- If any problems are encountered reading the access keys from
the specified file.IllegalArgumentException
- If the specified properties file does not contain the
required keys.public PropertiesCredentials(InputStream inputStream) throws IOException
inputStream
- The input stream containing the credential properties.IOException
- If any problems occur while reading from the input stream.public String getAccessKeyId()
Credentials
getAccessKeyId
in interface Credentials
public String getSecretKey()
Credentials
getSecretKey
in interface Credentials
Copyright © 2017. All Rights Reserved.