Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 82035 invoked from network); 28 Mar 2009 12:56:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Mar 2009 12:56:15 -0000 Received: (qmail 70343 invoked by uid 500); 28 Mar 2009 12:56:14 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 70223 invoked by uid 500); 28 Mar 2009 12:56:14 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 70212 invoked by uid 99); 28 Mar 2009 12:56:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Mar 2009 12:56:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Mar 2009 12:56:12 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 694D1234C003 for ; Sat, 28 Mar 2009 05:55:50 -0700 (PDT) Message-ID: <1791557969.1238244950416.JavaMail.jira@brutus> Date: Sat, 28 Mar 2009 05:55:50 -0700 (PDT) From: "Christian Grobmeier (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (COMPRESS-59) ArchiveEntry could have toString methods for formatting header contents In-Reply-To: <2128381595.1238181770444.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COMPRESS-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693433#action_12693433 ] 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 java.util.zip.ZipEntry implements ArchiveEntry, Cloneable Why not simply implement toString() for the 5 classes we have? I would think that toString() should return all header data.as 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: 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.