commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary D. Gregory (Jira)" <j...@apache.org>
Subject [jira] [Resolved] (VFS-769) TGZ fsManager.createFileSystem fails
Date Sun, 06 Sep 2020 22:50:00 GMT

     [ https://issues.apache.org/jira/browse/VFS-769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gary D. Gregory resolved VFS-769.
---------------------------------
    Fix Version/s: 2.7.0
       Resolution: Fixed

> TGZ fsManager.createFileSystem fails
> ------------------------------------
>
>                 Key: VFS-769
>                 URL: https://issues.apache.org/jira/browse/VFS-769
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.6.0
>            Reporter: Thomas BELOT
>            Priority: Major
>             Fix For: 2.7.0
>
>
> {code:java}
> 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);{code}
> Fails with this stack trace :
> {noformat}
> 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
> {noformat}
> but if I explicitly states that this is *tgz* scheme, it works fine
> {code:java}
> FileObject res = fsManager.createFileSystem("tgz",f2);{code}
> This seems linked to the following lines :
> [default FS manager disables TGZ scheme and convert it to TAR scheme|https://gitbox.apache.org/repos/asf?p=commons-vfs.git;a=blob;f=commons-vfs2/src/main/resources/org/apache/commons/vfs2/impl/providers.xml;h=332f2ffa6fad2bbe0a377fcd2c5d93df1f3cac7b;hb=HEAD#l162]
and [checks for TGZ scheme|https://gitbox.apache.org/repos/asf?p=commons-vfs.git;a=blob;f=commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java;h=739cc797bd553f2cbc995e31bc744fb7f8780659;hb=HEAD#l171]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message