How to load csv file using classpath? Before this I tried loading file using FileReader which works fine when running locally but when deployed into external server throws exceptions like FileNotFound. Below code works in local, but when deployed the jar on tomcat folder www/[jar] throws this exception Unfortunately, I cannot provide the original code. here is the gist:
BufferedReader br = new BufferedReader(new FileReader("src/SSR.csv"));
while ((line = br.readLine()) != null) {
// use comma as separator
String[] cols = line.split(",");
map.put(cols[1],cols[0]);