Return-Path: Delivered-To: apmail-maven-archiva-dev-archive@locus.apache.org Received: (qmail 16928 invoked from network); 11 Apr 2008 08:57:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Apr 2008 08:57:51 -0000 Received: (qmail 17771 invoked by uid 500); 11 Apr 2008 08:57:51 -0000 Delivered-To: apmail-maven-archiva-dev-archive@maven.apache.org Received: (qmail 17739 invoked by uid 500); 11 Apr 2008 08:57:51 -0000 Mailing-List: contact archiva-dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: archiva-dev@maven.apache.org Delivered-To: mailing list archiva-dev@maven.apache.org Received: (qmail 17730 invoked by uid 99); 11 Apr 2008 08:57:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2008 01:57:51 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [210.50.30.235] (HELO mx05.syd.iprimus.net.au) (210.50.30.235) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2008 08:56:57 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjMBAKDE/kfKQ1mw/2dsb2JhbAAIrA4 X-IronPort-AV: E=Sophos;i="4.25,640,1199624400"; d="scan'208";a="107761991" Received: from unknown (HELO [192.168.237.213]) ([202.67.89.176]) by smtp05.syd.iprimus.net.au with ESMTP; 11 Apr 2008 18:57:13 +1000 Message-Id: <21573605-9D1A-42F5-8CA3-D39E48CF95A6@apache.org> From: Brett Porter To: archiva-dev@maven.apache.org In-Reply-To: <47FC489C.7050101@erdfelt.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: [plexus work] archiva-checksums Date: Fri, 11 Apr 2008 18:57:07 +1000 References: <47FC489C.7050101@erdfelt.com> X-Mailer: Apple Mail (2.919.2) X-Virus-Checked: Checked by ClamAV on apache.org Looks good to me. I say roll it into trunk. A couple of uncertainties: - isn't doFinal required? - I think it can use more tests Here's some nitpicking that might reduce the amount of code and make it clearer: - rename Hash to ChecksumAlgorithm (might as well be consistent and use checksum everywhere instead of alternating through Hash, Digest, Checksum?) - likewise Hasher -> Checksum - there some duplicated code in isValidChecksums and fixChecksums that can be factored out - what about passing referenceFile as a final field, since every method uses it? - but if not, it'd be better if the arg order of getChecksumFile and createChecksum and calculateChecksum were consistent (I would go with File first) - I'd rename ChecksumFile as ChecksummedFile - parseChecksum can be private? - the two isValidChecksum(s) methods do different things. isValidChecksum should be isValidChecksum(Hash hash) { return isValidChecksums( new Hash[] { hash } ); }. Maybe another static convenience method is needed for the checksum file checkChecksumFile( File checksumFile ). - Brett On 09/04/2008, at 2:39 PM, Joakim Erdfelt wrote: > I've been taking a stab and removing some of our dependencies on > various plexus components. > > First up, plexus-digest. > > I've taken the varied code from many locations and come up with a > stand alone archiva-checksum lib/component that I hope to be able to > integrate into archiva/trunk. > > So ... uhm ... consider this a call for discussion. ;-) > > - Joakim -- Brett Porter brett@apache.org http://blogs.exist.com/bporter/