commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COMPRESS-59) ArchiveEntry could have toString methods for formatting header contents
Date Sat, 28 Mar 2009 13:23:50 GMT

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

Sebb commented on COMPRESS-59:
------------------------------

I'd overlooked that Zip and Jar cannot extend a new Abstract class. It's a pity interfaces
can't have method implementations.
It just seemed like a simple method of providing the implementation with little effort.

Also, from the testing point of view, it might make it simpler to test if the same output
was guaranteed for each type of archive entry.

Perhaps the solution is to write a utility method that generates "standard" output from an
ArchiveEntry.

Regarding hashCode() and equals() - we only need to override those if two different instances
can/should be regarded as equal.
I'm not sure when or why one would want to do that, but perhaps there is a use-case.

> ArchiveEntry could have toString methods for formatting header contents
> -----------------------------------------------------------------------
>
>                 Key: COMPRESS-59
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-59
>             Project: Commons Compress
>          Issue Type: Improvement
>            Reporter: Sebb
>            Priority: Minor
>
> I think it would be useful if the ArchiveEntry interface had some methods for formatting
the entry information as a String.
> This could then be used to create an Archive scanner to list archive contents, for example.
> There should probably be two methods:
> toShortString() - shows name, type and size only.
> toLongString() - shows all the details.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message