diff --git a/web3-credential-server/src/main/java/web3/s3Storage/service/S3StorageService.java b/web3-credential-server/src/main/java/web3/s3Storage/service/S3StorageService.java index 7560c0a..645de1b 100644 --- a/web3-credential-server/src/main/java/web3/s3Storage/service/S3StorageService.java +++ b/web3-credential-server/src/main/java/web3/s3Storage/service/S3StorageService.java @@ -256,19 +256,17 @@ public HashMap getPdfMetadata( String pdfUrl) { metadata = new HashMap<>(response.metadata()); if (metadata.isEmpty()) { - System.out.println("No user-defined metadata found for this object."); + throw new RuntimeException("No user-defined metadata found for this object."); } } catch (S3Exception e) { - System.err.println("Failed to retrieve metadata: " + e.getMessage()); - return new HashMap<>(); + throw new RuntimeException("Failed to retrieve metadata: " + e.getMessage()); } return metadata; } public String getMetadataForPage(String pdfUrl, int pageNumber) { - System.out.println("pdfUrl = " + pdfUrl); String fileName = extractKeyFromUrl(pdfUrl); GetObjectRequest getRequest = GetObjectRequest.builder() @@ -280,7 +278,6 @@ public String getMetadataForPage(String pdfUrl, int pageNumber) { Map metadata = getObjectResponse.metadata(); HashMap decodedMetadata = decodeMetadata(metadata); - System.out.println("decodedMetadata = " + decodedMetadata); String pageKey = "page-" + pageNumber; @@ -340,7 +337,7 @@ public void deletePdf(String urlToDelete) { .key(key) .build()); } catch (S3Exception e) { - System.err.println("Failed to delete photo from S3: " + e.getMessage()); + throw new RuntimeException("Failed to delete photo from S3: " + e.getMessage()); } } @@ -405,7 +402,6 @@ private HashMap changeForNewMetadata(int pageNumberToRemove, Has newPageNumbers.add(pageNumber); } } - System.out.println("pageSize = " + pageSize); // 새로운 메타데이터 해시맵 생성 HashMap newMetadata = new HashMap<>();