Bug 63344 - Support POIFSFileSystem that uses a temp file for backing - to support encryption of large files
Summary: Support POIFSFileSystem that uses a temp file for backing - to support encryp...
Alias: None
Product: POI
Classification: Unclassified
Component: POIFS (show other bugs)
Version: 4.0.x-dev
Hardware: PC Mac OS X 10.1
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2019-04-13 09:55 UTC by PJ Fanning
Modified: 2021-10-11 12:37 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description PJ Fanning 2019-04-13 09:55:34 UTC

POIFSFileSystem is needed for agile encryption. By default, POIFSFileSystem uses in-memory data source.

The support for file-backed data source assumes the file is OLE encoded. This is a problem if you want to take an OOXML file and encrypt it.

My suggestion is that we create a TempFilePOIFSFileSystem that uses an initially empty temp file as the data source backing.
Comment 1 PJ Fanning 2019-04-13 10:04:26 UTC

I'm happy to remove this if anyone thinks there is a better way to do this.
Comment 2 Andreas Beeker 2019-04-13 13:09:08 UTC
But to resolve the problem mentioned in the stack overflow issue, we also need to make sure to use a blocksize of 4096 bytes and check other issues, e.g. to handle large byte arrays differently.
I'm currently on the road but afaik there was already some temporary file used in encrypting agile, because the written amount of bytes has to be prefixed.
Comment 3 PJ Fanning 2021-10-11 12:37:48 UTC
this was done