Here is the structure of my maven project:
main and test folders are under src folder, java and resources folders are under main folder,
in the resources folder, there is a csv file ready for reading.
src
--main
|-- java
|-- resources
|-- test.csv
test
Currently, I am trying to overwrite the test.csv file using supercsv library.
I know that public CsvMapWriter(Writer writer, CsvPreference preference)
method is helpful on that.
So, I am trying to use OutputStreamWriter, but how to access that file like using:
InputStreamReader reader = new InputStreamReader(getClass().getClassLoader().getResourceAsStream("acacia_implexa.csv"));
mapReader = new CsvMapReader(reader, CsvPreference.STANDARD_PREFERENCE);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…