To read excel file resources using FileSystemResource, remove unnecessary validation check in PoiItemReader.openExcelFile method
if (!workbookStream.markSupported() && !(workbookStream instanceof PushbackInputStream)) {
throw new IllegalStateException("InputStream MUST either support mark/reset, or be wrapped as a PushbackInputStream");
}
Validation check is unnecessary because WorkbookFactory.create(workbookStream) method wrap InputStream as PushBackInputStream when that InputStream isn’t marksupported
if(!((InputStream)inp).markSupported()) {
inp = new PushbackInputStream((InputStream)inp, 8);
}
So after removing unnecessary validation check, I tested PoiItemReader.openExcelFile method by putting FileSystemResource as a parameter value and check it perfectly works.
This is the solution to the issue #34
To read excel file resources using FileSystemResource, remove unnecessary validation check in PoiItemReader.openExcelFile method
Validation check is unnecessary because WorkbookFactory.create(workbookStream) method wrap InputStream as PushBackInputStream when that InputStream isn’t marksupported
So after removing unnecessary validation check, I tested PoiItemReader.openExcelFile method by putting FileSystemResource as a parameter value and check it perfectly works.
@mminella , @mdeinum please check my pull request