Пример #1
0
 public AWSClient(AwsConfig awsConfig) {
   if (awsConfig == null) {
     throw new IllegalArgumentException("AwsConfig is required!");
   }
   if (awsConfig.getAccessKey() == null) {
     throw new IllegalArgumentException("AWS access key is required!");
   }
   if (awsConfig.getSecretKey() == null) {
     throw new IllegalArgumentException("AWS secret key is required!");
   }
   this.awsConfig = awsConfig;
   endpoint = awsConfig.getHostHeader();
   if (awsConfig.getRegion() != null && awsConfig.getRegion().length() > 0) {
     setEndpoint("ec2." + awsConfig.getRegion() + ".amazonaws.com");
   }
 }