Skip to content

Commit

Permalink
hotfix: 파일 경로 Path 클래스로 지정
Browse files Browse the repository at this point in the history
  • Loading branch information
jongmee committed Aug 16, 2024
1 parent 8b005f2 commit 7dbc5f6
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.pokerogue.helper.battle;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import lombok.RequiredArgsConstructor;
Expand All @@ -24,8 +27,10 @@ public class DataInitializer implements ApplicationRunner {

@Override
public void run(ApplicationArguments args) {
String weatherFilePath = System.getProperty("user.dir") + "/" + "src/main/java/com/pokerogue/helper/battle/data/weather.txt";
try (BufferedReader br = new BufferedReader(new FileReader(weatherFilePath))) {
Path path = Paths.get("src/main/java/com/pokerogue/helper/battle/data/weather.txt");
Path absolutePath = path.toAbsolutePath();
File file = new File(absolutePath.toUri());
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
int lineCount = 0;
String line;
while ((line = br.readLine()) != null) {
Expand Down

0 comments on commit 7dbc5f6

Please sign in to comment.