Read remote .csv file using opencsv
CSVReader
takes a Reader
argument according to the documentation, so it isn't limited to a FileReader
for the parameter.
To use a CSVReader
without saving the file first, you could use a BufferedReader
around a stream loading the data:
URL stockURL = new URL("http://example.com/stock.csv");
BufferedReader in = new BufferedReader(new InputStreamReader(stockURL.openStream()));
CSVReader reader = new CSVReader(in);
// use reader