[ 
https://issues.apache.org/jira/browse/COMPRESS-124?focusedWorklogId=355120&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-355120
 ]

ASF GitHub Bot logged work on COMPRESS-124:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Dec/19 11:31
            Start Date: 06/Dec/19 11:31
    Worklog Time Spent: 10m 
      Work Description: tcurdt commented on pull request #87: COMPRESS-124 : 
Add support for extracting sparse entries from tar archives
URL: https://github.com/apache/commons-compress/pull/87#discussion_r354789475
 
 

 ##########
 File path: 
src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
 ##########
 @@ -516,6 +713,22 @@ private void paxHeaders() throws IOException{
                                 final String value = new String(rest, 0,
                                                           restLen - 1, 
CharsetNames.UTF_8);
                                 headers.put(keyword, value);
+
+                                // for 0.0 PAX Headers
+                                if(keyword.equals("GNU.sparse.offset")) {
+                                    sparseHeader = new 
TarArchiveStructSparse(Long.parseLong(value), 0);
 
 Review comment:
   better extract the keys into a static String
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 355120)
    Time Spent: 3h 40m  (was: 3.5h)

> Unable to extract a sparse entries from tar archives
> ----------------------------------------------------
>
>                 Key: COMPRESS-124
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-124
>             Project: Commons Compress
>          Issue Type: New Feature
>          Components: Archivers
>    Affects Versions: 1.1, 1.2
>         Environment: Platform independent. However, I'm currently using 
> Window 7 Enterprise.
>            Reporter: Patrick Dreyer
>            Priority: Major
>              Labels: tar
>             Fix For: 1.20
>
>         Attachments: gnuSparseFile.patch
>
>          Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> Good news first: I already have the patch ready for that.
> I got several TAR files which I could not extract with any of the existing 
> Java implementations, but I could extract all those TAR files successfully 
> with GNU tar.
> It turned out that all the failing TAR files contained so called sparse 
> files. Investigating the source code of all existing Java TAR implementations 
> showed me that none of them even recognizes the existence of GNU sparse 
> entries.
> Actually, I don't need to process one of the contained sparse files and I'm 
> happy if I'm at least able to correctly untar all the non-sparsed files. 
> Thus, it would be sufficient recognizing sparse files without the need to 
> correctly un-sparse them while extracting. As long as all non-sparsed files 
> get extracted correctly, I'm fine.
> The TAR files in question have all been VMware Diagnostic File bundles.
> See 
> http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=653
>  to know how to get them.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to