commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Grobmeier (JIRA)" <>
Subject [jira] Commented: (COMPRESS-59) ArchiveEntry could have toString methods for formatting header contents
Date Sat, 28 Mar 2009 12:55:50 GMT


Christian Grobmeier commented on COMPRESS-59:

By extending from AbstractArchiveEntry, the JarArchiveEntry would be more ugly.

Currently it is:

public class JarArchiveEntry extends ZipArchiveEntry implements ArchiveEntry

Same is with ZipArchiveEntry:

public class ZipArchiveEntry extends
    implements ArchiveEntry, Cloneable 

Why not simply implement toString() for the 5 classes we have? I would think that toString()
should return all header a string.
This reminds me that we have to override hashCode (if somebody wants to put this archiveentry
into a hashmap) and equals() too.

> ArchiveEntry could have toString methods for formatting header contents
> -----------------------------------------------------------------------
>                 Key: COMPRESS-59
>                 URL:
>             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.

View raw message