commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Grobmeier <grobme...@gmail.com>
Subject Re: [COMPRESS] Changeset ideas
Date Mon, 30 Mar 2009 04:48:48 GMT
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 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.

> 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.

Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message