Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2, 2.4, 2.3, 2.4.1
-
None
Description
When using FileObject#exists and FileObject#getContent on a ZIP file (in any order), the reference to the parent file system is set to null.
final FileObject zippedFile = new OnCallRefreshFileObject(fileInZip()); assertNotNull(zippedFile.getFileSystem().getParentLayer()); zippedFile.exists(); zippedFile.getContent(); assertNotNull(zippedFile.getFileSystem().getParentLayer()); // fails
For an executable example, refer to https://github.com/f4lco/vfs-repro/blob/master/src/test/java/vfs/ZipParentLayerTest.java.
I come to believe this does not work as intended. I'm also relatively clueless about a potential fix or workaround. For me, this bug blocks upgrading from VFS 2.1.