[ https://issues.apache.org/jira/browse/COMPRESS-700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17955317#comment-17955317 ]
Gary D. Gregory commented on COMPRESS-700: ------------------------------------------ [~mxnguyen] The file {_}flutter_awesome_buttons-0.1.0.tar{_}'s first entry is "build/app.dll", a file of size 0, which doesn't make sense for a DLL, and I imagine this is supposed to be a Windows DLL, right? What is also odd is that in the TAR entry for this file the magic and version fields are both empty, which is unusual IMO. Usually the magic field is a string like "ustar". After this file, our code can't read the next entry. Do you know this TAR file was built? > Can't extract TAR file flutter_awesome_buttons-0.1.0.tar > -------------------------------------------------------- > > Key: COMPRESS-700 > URL: https://issues.apache.org/jira/browse/COMPRESS-700 > Project: Commons Compress > Issue Type: Bug > Components: Archivers > Affects Versions: 1.26.1, 1.26.2, 1.27.0, 1.27.1 > Reporter: Michael Nguyen > Assignee: Gary D. Gregory > Priority: Major > Fix For: 1.28.0 > > Attachments: flutter_awesome_buttons-0.1.0.tar > > > Prior to version 1.26.1, calling ArchiveStreamFactory.detect on the attached > TAR file identifies it as a TAR file properly but now throws an > ArchiveException. It seems related to the changes to address COMPRESS-644, > specifically the the entry.getSize() > 0 check on line 288 of > ArchiveStreamFactory.java. > Below is some sample code to reproduce the error (the below code runs without > errors when tested on 1.26.0): > {code:java} > import org.apache.commons.compress.archivers.ArchiveStreamFactory; > import org.apache.commons.io.FileUtils; > import org.junit.Test; > import java.io.BufferedInputStream; > import java.io.File; > import java.nio.file.Files; > import static > com.sonatype.data.testing.utils.ResourcesUtils.getResourceAsInputStream; > public class TarArchiveTest > { > @Test > public void testTarArchive() throws Exception { > String fileToTest = "icure_medical_device_dart_sdk-1.2.10.tar"; > File sourceFile = new File(fileToTest); > FileUtils.copyInputStreamToFile(getResourceAsInputStream(fileToTest), > sourceFile); > BufferedInputStream fileInputStream = new > BufferedInputStream(Files.newInputStream(sourceFile.toPath())); > System.out.println("Detected archive type: " + > ArchiveStreamFactory.detect(fileInputStream)); > } > } {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)