[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Commented] (COMPRESS-310) "No Archiver found for the stream signature" for empty .tar.gz
From:       "Stefan Bodewig (JIRA)" <jira () apache ! org>
Date:       2015-02-28 6:50:04
Message-ID: JIRA.12778421.1425088549000.41165.1425106204591 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/COMPRESS-310?page=com.atlassian.jira.plugi \
n.system.issuetabpanels:comment-tabpanel&focusedCommentId=14341385#comment-14341385 ] \


Stefan Bodewig commented on COMPRESS-310:
-----------------------------------------

If you look at the "archive" you'll see it consists of zero-bytes only.  \
ArchiveStreamFactory has no way of detecting this is a TAR archive, it could be \
anything.  If you try to pass the same archive to a TarArchiveInputStream it should \
deal with it properly.

> "No Archiver found for the stream signature" for empty .tar.gz
> --------------------------------------------------------------
> 
> Key: COMPRESS-310
> URL: https://issues.apache.org/jira/browse/COMPRESS-310
> Project: Commons Compress
> Issue Type: Bug
> Components: Archivers
> Affects Versions: 1.9
> Environment: Ubuntu 14.04.1 LTS, x64, Oracle JDK 1.8.0_25
> Reporter: Nikolai Amelichev
> Attachments: uzhos.tar.gz
> 
> 
> GNU tar can unpack empty gzipped tar archive *uzhos.tar.gz* without any problems. \
> commons-compress detects gzip compression, but not tar archive format of the \
> uncompressed data. The archive was created by running GNU tar in an empty directory \
> like this: {noformat}tar xzf uzhos.tar.gz .{noformat} and then manually deleting \
> the *'.'* directory entry in *file-roller* archive manager. Minimal test \
> demonstrating the problem: {code:java}
> package ru.zombator;
> import java.io.*;
> import org.apache.commons.compress.archivers.*;
> import org.apache.commons.compress.compressors.*;
> import org.junit.Test;
> import org.junit.Assert;
> public class UzhosTest {
> @Test
> public void unpack_empty_gzipped_tar() throws IOException, ArchiveException, \
> CompressorException { try (FileInputStream in = new \
> FileInputStream("uzhos.tar.gz"); BufferedInputStream bis = new \
> BufferedInputStream(in); InputStream comp = new \
> CompressorStreamFactory().createCompressorInputStream(bis); BufferedInputStream \
> compBis = new BufferedInputStream(comp); ArchiveInputStream arch = new \
> ArchiveStreamFactory().createArchiveInputStream(compBis)) { \
> Assert.assertNull(arch.getNextEntry()); }
> }
> }
> {code}
> Stacktrace:
> {code:java}
> org.apache.commons.compress.archivers.ArchiveException: No Archiver found for the \
> stream signature  at \
> org.apache.commons.compress.archivers.ArchiveStreamFactory.createArchiveInputStream(ArchiveStreamFactory.java:359)
>   at ru.zombator.UzhosTest.unpack_empty_gzipped_tar(ShittyTest.java:16)
> 	<23 internal calls>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic