From 02305b3c150b8772d171c3e233ff3e456bcdfc56 Mon Sep 17 00:00:00 2001 From: Joel Balcaen Date: Fri, 19 Apr 2024 13:07:04 -0300 Subject: [PATCH] print ln --- .../com/levio/awsdemo/attachmentsaver/App.java | 16 ++++++---------- .../attachmentsaver/service/S3Service.java | 1 - 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/lambdas/AttachmentSaver/AttachmentSaverFunction/src/main/java/com/levio/awsdemo/attachmentsaver/App.java b/lambdas/AttachmentSaver/AttachmentSaverFunction/src/main/java/com/levio/awsdemo/attachmentsaver/App.java index 023ce41..a642ba5 100644 --- a/lambdas/AttachmentSaver/AttachmentSaverFunction/src/main/java/com/levio/awsdemo/attachmentsaver/App.java +++ b/lambdas/AttachmentSaver/AttachmentSaverFunction/src/main/java/com/levio/awsdemo/attachmentsaver/App.java @@ -31,13 +31,6 @@ public App(S3Service s3Service) { } public String handleRequest(final S3EventNotification input, final Context context) { - try { - String json = objectMapper.writeValueAsString(input); - System.out.println(json); - } catch (JsonProcessingException e) { - throw new RuntimeException(e); - } - List responses = new ArrayList<>(); input.getRecords().forEach(s3EventNotificationRecord -> { @@ -57,9 +50,12 @@ public String handleRequest(final S3EventNotification input, final Context conte }); try { - return objectMapper.writeValueAsString( - new Response(200, responses.stream().map(PutObjectResponse::toString).toList()) - ); + var response = objectMapper.writeValueAsString( + new Response(200, responses.stream().map(PutObjectResponse::toString).toList()) + ); + System.out.println(response); + return response; + } catch (JsonProcessingException e) { e.printStackTrace(); new Response(400, List.of("Error processing request")); diff --git a/lambdas/AttachmentSaver/AttachmentSaverFunction/src/main/java/com/levio/awsdemo/attachmentsaver/service/S3Service.java b/lambdas/AttachmentSaver/AttachmentSaverFunction/src/main/java/com/levio/awsdemo/attachmentsaver/service/S3Service.java index cc6ef91..000c2ee 100644 --- a/lambdas/AttachmentSaver/AttachmentSaverFunction/src/main/java/com/levio/awsdemo/attachmentsaver/service/S3Service.java +++ b/lambdas/AttachmentSaver/AttachmentSaverFunction/src/main/java/com/levio/awsdemo/attachmentsaver/service/S3Service.java @@ -35,7 +35,6 @@ public List getAttachments(S3EventNotification.S3Entity s3Entity) throws M .build(); ResponseBytes objectBytes = s3.getObjectAsBytes(objectRequest); - System.out.println(new String(objectBytes.asByteArray())); InputStream inputStream = objectBytes.asInputStream(); Properties props = new Properties();