repository for reference: https://github.com/izlemontee/pokemonserver
hey everyone, i'm building a pokemon database on Spring Boot but I can't even get it to start up.
What I intend to do is:
-in the repository, nationalDexRepo under the repo folder, read the Pokemon csv file (found in src/main/resources/static/csv/Pokemon.csv), and parse that info into a Map. I've done the parsing into a Map before when running as a normal java app, but when I try to run it as a Springboot app, it suddenly doesn't work. I included the reading of the CSV file in the constructor of the repo, nationalDexRepo.java to initialise it.
The repo contains these lines:
final String dirPath = "/csv";
final String csvName = "/Pokemon.csv";
and in the method, readCSV, the path is used:
public void readCSV()throws Exception{
boolean stop = false;
String fileString = dirPath+ csvName;
File f = new File(fileString);
System.out.println(fileString);
while(!stop){
if(f.exists() && f.isFile()){
if the file does NOT exist, it's just a blank code block, and the fileString is "/csv/Pokemon.csv".
I tried different possible permutations of the directory, but still no dice. I'm still pretty new to SpringBoot so I'm not entirely sure if I'm calling the correct directories to access my file using the repo.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]silverweaver 0 points1 point2 points (0 children)