commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolai Amelichev (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (COMPRESS-310) "No Archiver found for the stream signature" for empty .tar.gz
Date Sat, 28 Feb 2015 01:59:04 GMT

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

Nikolai Amelichev updated COMPRESS-310:
---------------------------------------
    Attachment: uzhos.tar.gz

Empty gzipped tar archive used by the test

> "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)

Mime
View raw message