commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: [COMPRESS] Changeset ideas
Date Sun, 29 Mar 2009 16:56:19 GMT
On 29/03/2009, sebb <> wrote:
> The current ChangeSet API allows for:
>  + deletion of entries by name
>  + addition of entries by ArchiveEntry and InputStream.

Forgot about "Move", which is not yet implemented.

I think that should be called "Rename", unless it really means to move
the entry elsewhere in the file.

>  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
>  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'm not sure if there is a use-case for adding entries relative to an
>  existing entry, and it would complicate the processing. None of the
>  archivers I have used allow this.]
>  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

or rename, if that has been requested.

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

Or combine them into a single HashMap which has operations delete,
replace, rename.

>  + 2 Lists for new entries.

Start and and.

>  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.
>  However, the creation of the collections would be slightly more involved.
>  It would probably be useful to have a "NewEntry" class which either
>  has a File, or has an InputStream + ArchiveEntry to describe it.
>  The "NewEntry" class might also be useful for ArchiveOutputStream.
>  WDYT?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message