Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B432E17924 for ; Tue, 3 Mar 2015 14:53:06 +0000 (UTC) Received: (qmail 17396 invoked by uid 500); 3 Mar 2015 14:53:06 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 17305 invoked by uid 500); 3 Mar 2015 14:53:06 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 17293 invoked by uid 99); 3 Mar 2015 14:53:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 14:53:06 +0000 Date: Tue, 3 Mar 2015 14:53:06 +0000 (UTC) From: "Nikolai Amelichev (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (COMPRESS-310) "No Archiver found for the stream signature" for empty .tar.gz MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)