Closed lealgamb closed 6 years ago
Those are web resources though, unlike the data file. Do any of the suggestions here work?
Will try them out! Sorry for rushing the PR.
I've been trying different approaches but I keep getting a FileNotFoundException. I moved the text file to src/main/resources
.
File not found exception. Check the stack trace to see what's wrong.
[INFO] java.io.FileNotFoundException: C:\Users\Leal%20Family\CodeU\CodeU-Nemo\target\chatapp-1.0-SNAPSHOT\WEB-INF\classes\NemoBot.txt (The system cannot find the path specified)
Here's some of the code that handles opening the file
Maybe all you need is:
NemoBot nemoBot = new NemoBot(classLoader.getResource("NemoBot.txt").getFile());
Still doesn't work. It gets the correct path but can't open the file.
Locally or on appengine?
Locally. Haven't tried on appengine.
I got it to work just now. I'll push the changes for review. Still have to try appengine.
I'm thinking of placing the text files in
webapp
since it's where the favicon andindex.jsp
are located.