Cleaning up unclosed ZipFile for archive in excel file

I could notice that you haven't closed your InputStream. If you do not close the stream, file will be locked until inputstream has been closed or JVM is shutdown.

So probably, the easiest thing in your context above is to auto-close by using a try-with-resources construct as,

try (FileInputStream inp = new FileInputStream(workbookPath)) {
    tempWB = (org.apache.poi.ss.usermodel.Workbook) new HSSFWorkbook(new POIFSFileSystem(inp)); 
} catch (Exception e) {
    Log.error("Class Utils | Method setExcelFile | Exception desc : "+ e.getMessage());
}

Hope it helps you. :)


I added tempWB.close(); and the error disappears! :)