Java Code Examples for com.amazonaws.services.s3.model.SSECustomerKey#setAlgorithm()

The following examples show how to use com.amazonaws.services.s3.model.SSECustomerKey#setAlgorithm() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AwsModule.java    From beam with Apache License 2.0 6 votes vote down vote up
@Override
public SSECustomerKey deserialize(JsonParser parser, DeserializationContext context)
    throws IOException {
  Map<String, String> asMap = parser.readValueAs(new TypeReference<Map<String, String>>() {});

  final String key = asMap.getOrDefault("key", null);
  final String algorithm = asMap.getOrDefault("algorithm", null);
  final String md5 = asMap.getOrDefault("md5", null);
  SSECustomerKey sseCustomerKey = new SSECustomerKey(key);
  if (algorithm != null) {
    sseCustomerKey.setAlgorithm(algorithm);
  }
  if (md5 != null) {
    sseCustomerKey.setMd5(md5);
  }
  return sseCustomerKey;
}