Skip to content

Commit

Permalink
πŸ› [FIX] jar 파일 read 였λ₯˜ μˆ˜μ •
Browse files Browse the repository at this point in the history
  • Loading branch information
dong2ast committed Aug 1, 2024
1 parent 53ea972 commit 867c19b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.sopt.lequuServer.domain.common.facade;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -13,6 +13,7 @@
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StreamUtils;

@Service
@RequiredArgsConstructor
Expand All @@ -38,10 +39,9 @@ public String getLottie(){
try {
// src/main/resources λ””λ ‰ν† λ¦¬μ˜ data.json 파일 경둜 읽기
ClassPathResource resource = new ClassPathResource("lottie.json");
Path path = resource.getFile().toPath();
String json = Files.readString(path);
InputStream inputStream = resource.getInputStream();

return json;
return StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8);
} catch (IOException e) {
log.error("IOE Error: {e}", e);
}
Expand Down

0 comments on commit 867c19b

Please sign in to comment.