You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "David Mollitor (Jira)" <ji...@apache.org> on 2022/12/28 18:41:00 UTC

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

David Mollitor created COMPRESS-636:
---------------------------------------

             Summary: 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


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)