I use Apache POI to upload and read the file. This is my code:
@PostMapping("/upload")
public void addPersonne(@RequestParam("file") MultipartFile file) throws IOException{
ZipSecureFile.setMinInflateRatio(0);
FileInputStream f = (FileInputStream) file.getInputStream();
XSSFWorkbook workbook = new XSSFWorkbook(f);
XSSFSheet sheet = workbook.getSheetAt(0);
for (Row row : sheet) {
DataFormatter df = new DataFormatter();
Personne per = new Personne();
per.setNumero(df.formatCellValue(row.getCell(0)));
persorepo.save(per);
}
}
I get an error because the object that I get is of type cell not int. Please what should I do to convert cell to int