You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2023/01/24 12:50:00 UTC

[jira] [Commented] (COMPRESS-636) Add Builder Class for TarEntry

    [ https://issues.apache.org/jira/browse/COMPRESS-636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17680202#comment-17680202 ] 

Gary D. Gregory commented on COMPRESS-636:
------------------------------------------

[~belugabehr] 

Feel free to provide a PR on GitHub, with tests of course ;)

> Add Builder Class for TarEntry
> ------------------------------
>
>                 Key: COMPRESS-636
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-636
>             Project: Commons Compress
>          Issue Type: New Feature
>            Reporter: David Mollitor
>            Priority: Major
>
> When looking at the TAR documentation, the suggested usage is:
>  
> {code:java}
> TarArchiveEntry entry = new TarArchiveEntry(name);
> entry.setSize(size);
> tarOutput.putArchiveEntry(entry);
> tarOutput.write(contentOfEntry);
> tarOutput.closeArchiveEntry();{code}
> [https://commons.apache.org/proper/commons-compress/examples.html]
>  
> In this use case, it would be nice if the TarArchiveEntry class took a _size_ parameter as part of the constructor, but even better would be a Builder class for general ArchiveEntry creation. 
> For example:
> {code:java}
> ArchiveEntryBuilder.newTarArchiveEntry().setName(name).setSize(size).build() {code}
> One could imagine a different ArchiveEntryBuilder.newXxxArchiveEntry() for each type available in the commons compress package.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)