https://issues.apache.org/bugzilla/show_bug.cgi?id=55692

bearbalu <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #3 from bearbalu <[email protected]> ---
As per the original issue when I call,  workbook =
WorkbookFactory.create(fileInputStream), I get the exception
java.lang.IllegalArgumentException: The supplied
POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an
excel
 file?. 

So I was able to use the following code in most cases to get to the underlying
excel.

NPOIFSFileSystem fs =  new NPOIFSFileSystem(stream);
EncryptionInfo info = new EncryptionInfo(fs);
Decryptor d = Decryptor.getInstance(info);
String password = Decryptor.DEFAULT_PASSWORD;
InputStream fInputStream = getEncryptedFileInputStream(xlsFile,errorMessages);
if (fInputStream != null) { 
    Workbook workbook = WorkbookFactory.create(fInputStream);
    fInputStream.close(); 
    return workbook; 
}

However, when I do this for the attached excel file, it crashes in
EncryptionInfo with the Exception org.apache.poi.EncryptedDocumentException:
Unsupported hash algorithm. So I am not even sure if this an encrypted file.

If I open the Excel and just re-save it,
WorkbookFactory.create(fileInputStream) works fine.

-- 
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]

Reply via email to