Summary: | OPCPackage should revert() instead of close() on failed open in some cases | ||
---|---|---|---|
Product: | POI | Reporter: | Tim Allison <tallison> |
Component: | OPC | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | trivial | ||
Priority: | P2 | ||
Version: | 5.2.0-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux |
Description
Tim Allison
2022-01-27 18:03:08 UTC
I changed the logging in r1897562. I don't think this warrants a warning log. Not sure if using "org.apache.poi.poifs.filesystem.FileMagic" would help you to determine the file-type before trying to do actual parsing? It looks at the first few bytes to quickly see if it looks like a zip-file, binary-OLE2 or some other older formats. In general I would use "revert()" at these points when opening the file fails and we are opening it read-only. I have the relevant changes locally, can add them to this bug later. |