Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoClosing doesn't seem to remove tmp files. #235

Open
GummyDonut opened this issue Jun 1, 2021 · 1 comment
Open

AutoClosing doesn't seem to remove tmp files. #235

GummyDonut opened this issue Jun 1, 2021 · 1 comment

Comments

@GummyDonut
Copy link

GummyDonut commented Jun 1, 2021

Thank you so much for this library, it saved us alot of time. I have a small question however?

Using the example provided(code below) on the ReadMe.md and version 2.1.0 of the library. The stream closes
but the tmp file still exists until you run 'workbook.close()'. Is this intentional? Should the autoclosable not do this on its own?

try (
  InputStream is = new FileInputStream(new File("/path/to/workbook.xlsx"));
  Workbook workbook = StreamingReader.builder()
          .rowCacheSize(100)
          .bufferSize(4096)
          .open(is)) {
  for (Sheet sheet : workbook){
    System.out.println(sheet.getSheetName());
    for (Row r : sheet) {
      for (Cell c : r) {
        System.out.println(c.getStringCellValue());
      }
    }
  }
}
@monitorjbl
Copy link
Owner

monitorjbl commented Jun 1, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants