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

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2, 2.4, 2.3, 2.4.1
    • Fix Version/s: 2.5.0
    • Labels:
      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

            • Assignee:
              Unassigned
              Reporter:
              falcod Falco
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: