} catch (AmazonServiceException ase) {
System.out.println("Caught an AmazonServiceException, which means your
request made it "
+ "to Amazon S3, but was rejected with an error response
for some reason.");
System.out.println("Error Message: " + ase.getMessage());
System.out.println("HTTP Status Code: " + ase.getStatusCode());
System.out.println("AWS Error Code: " + ase.getErrorCode());
System.out.println("Error Type: " + ase.getErrorType());
System.out.println("Request ID: " + ase.getRequestId());
throw ase;
} catch (AmazonClientException ace) {
System.out.println("Caught an AmazonClientException, which means the
client encountered "
+ "a serious internal problem while trying to communic
ate with S3, "
+ "such as not being able to access the network.");
System.out.println("Error Message: " + ace.getMessage());
throw ace;
}
}
private static String getProperty(Properties config, String name) {
if( config.containsKey(name)){
return config.getProperty(name);
}
throw new RuntimeException(name+" property not configured");
}
}
API Version 2012-12-01
123
Amazon Redshift Management Guide
Example: Uploading Client-Side Encrypted Data