poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 57161] New: Add a warning against opening Excel file with WorkbookFactory.create(File)
Date Wed, 29 Oct 2014 08:59:54 GMT
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: dev@poi.apache.org
          Reporter: PhiLho@GMX.net

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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message