I have the following project structure
Is it possible to access usersDev.json via relative path? when I try with this JsonReader jsonReader = new JsonReader(new FileReader("src\\\\main\\\\webapp\\\\static\\\\usersDev.json"));
It can not find the file. Any help is appreciated.
Never try to read resources from inside an application with File
. Use getResourceAsStream()
instead.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.