private void readMapping()

in emr-user-role-mapper-application/src/main/java/com/amazon/aws/emr/mapping/S3BasedUserMappingImplBase.java [47:66]


  private void readMapping() {
    log.info("Load the mapping from S3 from {}/{}", bucketName, key);
    try (S3Object s3object = getS3Client().getObject(new GetObjectRequest(
        bucketName, key))) {
      S3ObjectInputStream s3InputStream = s3object.getObjectContent();
      String jsonString = null;
      try {
        jsonString = getS3FileAsString(s3InputStream);
      } catch (IOException e) {
        throw new RuntimeException("Could not fetch the mapping file from S3.", e);
      }
      // Update the ETag
      etag = s3object.getObjectMetadata().getETag();
      processFile(jsonString);
    } catch (AmazonClientException ace) {
      log.error("AWS exception {}", ace.getMessage(), ace);
    } catch (IOException e) {
      log.error("Could not load mapping from S3", e);
    }
  }