Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-733

Parent layer of ZipFileSystem set to null through OnCallRefreshFileObject and DecoratedFileObject.refresh()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2, 2.4, 2.3, 2.4.1
    • 2.5.0
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            falcod Falco
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: