https://issues.apache.org/bugzilla/show_bug.cgi?id=57161
Bug ID: 57161
Summary: Add a warning against opening Excel file with
WorkbookFactory.create(File)
Product: POI
Version: 3.11-dev
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
Assignee: [email protected]
Reporter: [email protected]
I wrote code opening an Excel file (XLS or XLSX) with an InputStream. I modify
the file, then I save it back. Worked well.
Re-reading the doc, I see that WorkbookFactory.create(File) uses less
resources, so I used this method instead.
All my tests failed. I got, for XLSX, a message "Can't obtain the input stream
from /docProps/app.xml", and for XLS, a message about an index out of bounds.
After investigation, I found I was not alone:
http://stackoverflow.com/questions/14117617/apache-poi-unable-to-write-to-an-existing-workbook
So I just reverted to read my file from an input stream (it isn't big anyway).
I can understand it can be a limitation of the underlying system (Windows 7
here).
But I suggest you put a warning against this kind of usage, when you recommend
to use this form of opening.
If you have a fix, or at least a way to make a friendlier error message, it
would be even better...
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]