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)

Reply via email to