You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Nikolai Amelichev (JIRA)" <ji...@apache.org> on 2015/03/03 15:53:06 UTC
[jira] [Resolved] (COMPRESS-310) "No Archiver found for the stream
signature" for empty .tar.gz
[ https://issues.apache.org/jira/browse/COMPRESS-310?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nikolai Amelichev resolved COMPRESS-310.
----------------------------------------
Resolution: Won't Fix
> "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)