[
https://issues.apache.org/jira/browse/COMPRESS-400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16046898#comment-16046898
]
ASF GitHub Bot commented on COMPRESS-400:
-----------------------------------------
GitHub user sesuncedu opened a pull request:
https://github.com/apache/commons-compress/pull/31
COMPRESS-400 It should be possible for users to create and access extra PAX
headers to tar archives
Add extra header map to tar archive entry.
Move PAX header processing code from TarArchiveInputStream to
TarAchiveEntry.
Use same code for processing user supplied extra headers - thus setting
"size "changes the value of getSize().
Add any extra PAX headers to output map when putting entry in
TarArchiveOutputStream.
Add simple tests for getting/setting xattr, setting "size", and round
tripping.
Signed-off-by: Simon Spero <[email protected]>
(cherry picked from commit 1d9b3c8)
Signed-off-by: Simon Spero <[email protected]>
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sesuncedu/commons-compress COMPRESS-400-REDUX
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/commons-compress/pull/31.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #31
----
commit 3a1d29e2474519c3930742cf3000b6323bb426a8
Author: Simon Spero <[email protected]>
Date: 2017-06-05T19:58:27Z
COMPRESS-400 It should be possible for users to create and access extra PAX
headers to tar archives
Add extra header map to tar archive entry.
Move PAX header processing code from TarArchiveInputStream to
TarAchiveEntry.
Use same code for processing user supplied extra headers - thus setting
"size "changes the value of getSize().
Add any extra PAX headers to output map when putting entry in
TarArchiveOutputStream.
Add simple tests for getting/setting xattr, setting "size", and round
tripping.
Signed-off-by: Simon Spero <[email protected]>
(cherry picked from commit 1d9b3c8)
Signed-off-by: Simon Spero <[email protected]>
----
> It should be possible for users to create and access extra PAX headers to tar
> archives
> ---------------------------------------------------------------------------------------
>
> Key: COMPRESS-400
> URL: https://issues.apache.org/jira/browse/COMPRESS-400
> Project: Commons Compress
> Issue Type: Improvement
> Components: Archivers
> Reporter: Simon Spero
> Priority: Minor
>
> It is very useful to be able to add extra PAX headers to tar entries. For
> example, a tar file containing maven artifacts could have extra headers
> carrying the groupid, artifactid, version, classifier, etc.
> If the appropriate prefixes are used, these headers can be extracted to posix
> extended attributes by gnu and bsdtar.
> This change requires adding a map to TarArchiveEntry to carry the extra
> headers, plus modifications to the TarArchive*Stream to save unrecognized
> headers when reading, and to add any extra headers when writing.
> I have created a prototype implementation, but have not merged it into my
> fork of the project. I don't have full tests written, because I was using
> gnutar as an oracle.
> I have also ignored the issue of writing values to standard headers like
> size, though since the PAX specification states that doing things like
> setting size=100 (if the real size is not in fact 100) is undefined, so I'm
> technically in compliance. The temptation is to do what was asked, then on
> close pop up a "Were you sure?" dialog, but that's mean. I guess I could use
> this to set the appropriate entry fields if doing so makes sense, but the
> easiest approach is to block setting any headers that would be consumed by
> the tar implementation when reading.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)