* 리팩터링

This commit is contained in:
kimjihun
2024-08-02 20:18:13 +09:00
parent b597977108
commit 8939611e36

View File

@@ -28,7 +28,8 @@ public class ExcelRowReader implements ItemReader<Row> {
Workbook workbook = WorkbookFactory.create(fileInputStream);
Sheet sheet = workbook.getSheetAt(0);
this.rowCursor = sheet.iterator();
// Skip header row if necessary
if (rowCursor.hasNext()) {
rowCursor.next();
}
@@ -36,10 +37,11 @@ public class ExcelRowReader implements ItemReader<Row> {
@Override
public Row read() {
if (rowCursor != null && rowCursor.hasNext()) {
return rowCursor.next();
} else {
return null; // No more rows to read
return null;
}
}
}