Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
JCR Installer 3.0.0
-
None
Description
Currently the BundleResourceProcessor marks the bundle input stream for 2048 bytes of read-head to read the MANIFEST.MF file. Unfortunately, this "limits" supprt for MANIFEST.MF files to 2048 bytes. We have one situation, where the actual MANIFEST.MF file is more than 64'000 bytes. Reading the MANIFEST.MF file succeeds but resetting the input stream fails.
I propose to modify the BundleResourceProcessor and the FileInstallableData as follows:
- BundleResourceProcessor.getMatchingBundle gets the InstallableData object and gets the InputStream directly from that one and also closes that "private" stream after reading the MANIFEST.MF file.
- FileInstallableData is modified to not open the InputStream before hand but to keep the JCR Property and open the stream on demand in the adaptTo method.
- BundleResourceProcessor.installOrUpdate is modified in the finally close to catch IOException on closing the input stream. In addition the null-check is not required because the data variable will never be null in the finally clause.
BTW: Opening the InputStream upfront in the FileInstallableData constructor may even leave this input stream open, should that stream not be retrieved to be closed !