List<String> list = new ArrayList<String>(); File convFile = new File(file.getOriginalFilename()); FileOutputStream fos = new FileOutputStream(convFile); fos.write(file.getBytes()); fos.close(); try { CsvParserSettings parserSettings = new CsvParserSettings(); parserSettings.selectFields("Email"); CsvParser parser = new CsvParser(parserSettings); List<String[]> allRows = parser.parseAll(new FileReader(convFile)); for (String[] strings : allRows) { for (String string : strings) { try { if (string.contains("@")) { list.add(string.trim()); } } catch (Exception e) { System.err.println("======Exception====>" + e); } } } } catch (Exception e) { System.err.println("======Exception====>" + e); }
java.io.FileNotFoundException: bit.csv (Permission denied) When I'm uploading CSV file getting the below exception?
1.4m articles
1.4m replys
5 comments
56.8k users