Пример #1
0
 /** Returns the AWS credentials for the specified profile. */
 public AWSCredentials getCredentials(String profileName) {
   final AWSCredentialsProvider provider = credentialProviderCache.get(profileName);
   if (provider != null) {
     return provider.getCredentials();
   } else {
     BasicProfile profile = allProfiles.getProfile(profileName);
     if (profile == null) {
       throw new IllegalArgumentException("No AWS profile named '" + profileName + "'");
     }
     final AWSCredentialsProvider newProvider = fromProfile(profile);
     credentialProviderCache.put(profileName, newProvider);
     return newProvider.getCredentials();
   }
 }
Пример #2
0
 public Map<String, BasicProfile> getAllBasicProfiles() {
   return allProfiles.getProfiles();
 }