File csv = new File(Executions.getCurrent().getDesktop().getWebApp().getRealPath("/WEB-INF/xls/demo/data.csv"));
CSVReader reader = new CSVReader(new FileReader(csv));
List<ComputerBean> data = new ArrayList<ComputerBean>();
String[] nextLine;
while ((nextLine = reader.readNext()) != null) {
ComputerBean computerBean = new ComputerBean();
computerBean.setId(nextLine[0]);
computerBean.setProduct(nextLine[1]);
computerBean.setBrand(nextLine[2]);
computerBean.setModel(nextLine[3]);
computerBean.setSerialNumber(nextLine[4]);
computerBean.setDate(nextLine[5]);
computerBean.setWarrantyTime(nextLine[6]);
computerBean.setCost(Double.valueOf(nextLine[7]).doubleValue());
computerBean.setOs(nextLine[8]);
computerBean.setSalvage(Double.valueOf(nextLine[9]).doubleValue());
data.add(computerBean);
}
return data;
}