@@ -0,0 +1,2388 @@
+package com.example.photo;%0A%0Aimport software.amazon.awssdk.auth.credentials.EnvironmentVariableCredentialsProvider;%0Aimport software.amazon.awssdk.core.SdkBytes;%0Aimport software.amazon.awssdk.regions.Region;%0Aimport software.amazon.awssdk.services.rekognition.RekognitionClient;%0Aimport software.amazon.awssdk.services.rekognition.model.Image;%0Aimport software.amazon.awssdk.services.rekognition.model.DetectLabelsRequest;%0Aimport software.amazon.awssdk.services.rekognition.model.DetectLabelsResponse;%0Aimport software.amazon.awssdk.services.rekognition.model.Label;%0Aimport software.amazon.awssdk.services.rekognition.model.RekognitionException;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport org.springframework.stereotype.Component;%0A%0A@Component%0Apublic class AnalyzePhotos %7B%0A%0A    public ArrayList DetectLabels(byte%5B%5D bytes, String key) %7B%0A%0A        Region region = Region.US_EAST_2;%0A        RekognitionClient rekClient = RekognitionClient.builder()%0A                .credentialsProvider(EnvironmentVariableCredentialsProvider.create())%0A                .region(region)%0A                .build();%0A%0A        try %7B%0A%0A            SdkBytes sourceBytes = SdkBytes.fromByteArray(bytes);%0A%0A            // Create an Image object for the source image%0A            Image souImage = Image.builder()%0A                    .bytes(sourceBytes)%0A                    .build();%0A%0A            DetectLabelsRequest detectLabelsRequest = DetectLabelsRequest.builder()%0A                    .image(souImage)%0A                    .maxLabels(10)%0A                    .build();%0A%0A            DetectLabelsResponse labelsResponse = rekClient.detectLabels(detectLabelsRequest);%0A%0A            // Write the results to a WorkItem instance%0A            List%3CLabel%3E labels = labelsResponse.labels();%0A%0A            System.out.println(%22Detected labels for the given photo%22);%0A%0A            ArrayList list = new ArrayList%3CWorkItem%3E();%0A            WorkItem item ;%0A            for (Label label: labels) %7B%0A                item = new WorkItem();%0A                item.setKey(key); // identifies the photo%0A                item.setConfidence(label.confidence().toString());%0A                item.setName(label.name());%0A                list.add(item);%0A            %7D%0A            return list;%0A%0A        %7D catch (RekognitionException e) %7B%0A            System.out.println(e.getMessage());%0A            System.exit(1);%0A        %7D%0A        return null ;%0A    %7D%0A%7D%0A

Create AnalyzePhotos.java