Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.21
-
None
-
None
Description
While version 1.20 is able to extract the ActiveMQ tar archive which can be found here (https://activemq.apache.org/components/classic/download/) the current master fails at extracting it with the following exception
java.io.IOException: Error detected parsing the header at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:385)
I made a bisect search and this reveals the error is introduced with COMPRESS-509. I made an analysis and found the following why the problem appears
- Error ist thrown after reading a file in the tar but the file has a "/" at the end
- In the currEntry.isGNULongNameEntry the currEntry.isDirectory evaluates to true for this file -> reason why the "/" is appended
- The underlying problem is that isDirectory also checks if the entry has a "/" at the end. But the decoded file name is not yet set in the currEntry. Since the entry before the file is a folder the name ends with "/" and isDirectory returns the wrong value
Since I already came this far I'll send a pulll request where the decoded name is set before checking if we need to append "/" to the entry name. With this change the ActiveMQ tar can be extracted correctly again.