Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 95995 invoked from network); 30 Mar 2009 11:35:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Mar 2009 11:35:07 -0000 Received: (qmail 63576 invoked by uid 500); 30 Mar 2009 11:35:06 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 63422 invoked by uid 500); 30 Mar 2009 11:35:06 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 63405 invoked by uid 99); 30 Mar 2009 11:35:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Mar 2009 11:35:06 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sebbaz@gmail.com designates 74.125.44.158 as permitted sender) Received: from [74.125.44.158] (HELO yx-out-1718.google.com) (74.125.44.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Mar 2009 11:34:58 +0000 Received: by yx-out-1718.google.com with SMTP id 3so1241652yxi.60 for ; Mon, 30 Mar 2009 04:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=F1B8CY/JA1gpGBI1TUtEtDvHCEMwOQYZLYpRe0GV6Rg=; b=HQmB0P8exe0dEZC4LpP82gQ269Nn+gWiRTugIq1K3yJq/aaHTYPqFvmLzreD1yCFL+ EhtmtFZ770vWXlfXn4C43M0t5ut9YwVUF3oK8ZbGubU4og+rE60nERJnWNhwq9rfgghZ ONORS2n19ecZMNPbanI1sVKAfhL1mVsOn8JlU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=UdRNETWL3qU9jHOEFarmCoSKLZMn5ndRlBVNwNArcDb6Q5Ju2tYnf35fcdlhqcf0Tq P+pwHDO1j1/pVhUd8MkO3eRhbPv5FEOWqmkbW3eCYOpAt4yVq+wJYGGkQj8CKf2P459t xyzfafoL9D7nxoxLGOQ/PiQCe492ZHqsyW3QU= MIME-Version: 1.0 Received: by 10.150.149.19 with SMTP id w19mr10014907ybd.56.1238412877185; Mon, 30 Mar 2009 04:34:37 -0700 (PDT) In-Reply-To: References: <25aac9fc0903290531x1ca2f86k85822985afdad46f@mail.gmail.com> Date: Mon, 30 Mar 2009 12:34:37 +0100 Message-ID: <25aac9fc0903300434q34953b29lbada14e3c930a02c@mail.gmail.com> Subject: Re: [COMPRESS] Changeset ideas From: sebb To: Commons Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 30/03/2009, Christian Grobmeier wrote: > Hi, > > > > The current ChangeSet API allows for: > > + deletion of entries by name > > + addition of entries by ArchiveEntry and InputStream. > > > > This is fine as far as it goes, but I think it would be useful to add: > > + addition of entries by File > > + replacement of an existing named entry by File or Entry+InputStream > > > Sounds good, esspecially the replacement. > About additions by file - we use only streams in the api, is it good > to start with File now? I think it would be useful to add File to the putxxx() methods, but I suggest we track that in a separate e-mail thread. > I think this is useful too, having in mind that I wanted to propose > some util classes which allow creating zip files on File basis. > > > > > > It may also be useful to allow the location of new entries to be > > specified. For example, one might want to add META-INF data at the > > front of an archive. It would be useful to specify the locations as: > > + start > > + end > > > I am not sure about this. I cannot imagine a use case for that. Start is definitely useful for things such as META-INF and NOTICE, LICENSE, README files. Otherwise, the default should be end of file. If I remember correctly, "ar" files have ordering requirements, but these are complicated, so are probably best dealt with by the appropriate utility on the OS. > > > I think it would be quite easy to implement: > > + open output file, add any starting entries > > + for each input entry, either copy, skip or replace with new entry > > + at end of input, add any final entries. > > + close archive files > > > > This could be achieved with: > > + HashSet containing names to be deleted > > + HashMap containing new entries for existing names > > + 2 Lists for new entries. > > > > Using Hashes would avoid scanning the list. > > Also, I don't think any of the above would need to be updated during > > perform(), which would allow them to be re-used on another archive. > > > That would be cool. Actually I was thinking about your suggestion with using > a copy of the Set to operate on. This would resolve this too. Indeed. > > Christian > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org