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

TGZ fsManager.createFileSystem fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.6.0
    • 2.7.0
    • None

    Description

      FileSystemManager fsManager = VFS.getManager();
      FileObject f1 = fsManager.resolveFile("file:///C:/DIR");
      FileObject f2 = f1.resolveFile("test.tgz");
      FileObject res = fsManager.createFileSystem(f2);
      System.out.println(res);

      Fails with this stack trace :

      Caused by: java.lang.IllegalStateException: org.apache.commons.vfs2.FileSystemException: Unknown message with code "Error detected parsing the header".
      	at MyClass.main(MyClass.java:30)
      Caused by: org.apache.commons.vfs2.FileSystemException: Unknown message with code "Error detected parsing the header".
      	at org.apache.commons.vfs2.provider.tar.TarFileSystem.init(TarFileSystem.java:117)
      	at org.apache.commons.vfs2.provider.AbstractVfsContainer.addComponent(AbstractVfsContainer.java:51)
      	at org.apache.commons.vfs2.provider.AbstractFileProvider.addFileSystem(AbstractFileProvider.java:98)
      	at org.apache.commons.vfs2.provider.AbstractLayeredFileProvider.createFileSystem(AbstractLayeredFileProvider.java:81)
      	at org.apache.commons.vfs2.impl.DefaultFileSystemManager.createFileSystem(DefaultFileSystemManager.java:896)
      	at org.apache.commons.vfs2.impl.DefaultFileSystemManager.createFileSystem(DefaultFileSystemManager.java:910)
      	at MyClass.main(MyClass.java:27)
      Caused by: java.io.IOException: Error detected parsing the header
      	at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:371)
      	at org.apache.commons.vfs2.provider.tar.TarFileSystem.init(TarFileSystem.java:80)
      	... 6 more
      Caused by: java.lang.IllegalArgumentException: At offset 124, 12 byte binary number exceeds maximum signed long value
      	at org.apache.commons.compress.archivers.tar.TarUtils.parseBinaryBigInteger(TarUtils.java:215)
      	at org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:179)
      	at org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1350)
      	at org.apache.commons.compress.archivers.tar.TarArchiveEntry.<init>(TarArchiveEntry.java:438)
      	at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:369)
      	... 7 more
      

      but if I explicitly states that this is tgz scheme, it works fine

      FileObject res = fsManager.createFileSystem("tgz",f2);

      This seems linked to the following lines :
      default FS manager disables TGZ scheme and convert it to TAR scheme and checks for TGZ scheme

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              thomas.belot Thomas BELOT
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: