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 design
Date Wed, 15 Apr 2009 15:24:35 GMT
> If there is a usecase for add then delete, then it seems to me that
> there is likely to be a use case for delete then add. The current code
> only supports the former.

Did you see ChangeSetTest.testDeletePlusAdd() ?
Is this what you want?

>>  Then there is the case, that you want to replace an existing entry.
>>  You would do it like that:
>>
>>  - Delete File A from the current stream
>>  - Add File A to the Stream
>>
>>  If you don't delete the file, two files with the same name are in one
>>  archive, which is bad.
>
> The same problem occurs if one adds a new entry with the same name as
> an existing entry. This could be checked, but it is not currently
> done.

True. The ChangeSet doesn't check if the same entry is added twice to it.
I think the second entry should replace the first.

A bigger problem is, if one adds an entry whcih allready exists in the stream.
I think the file named A in the ChagneSet should replace the file
named A which is allready in the stream.

>>  Maybe we hs ould have an Cchange of type ==
>>  replace which puts those delete change and the add change in order?
>
> One might want to distinguish various different cases.

Definitly.

> Should a file add fail if there is already a matching file, or should
> it replace?

Thinking on Windows Explorer, I think it should replace. Or maybe
leave this option to the user with an param in ChangeSet? Default =
replace, failOnDuplicate() = fail?

> Should a file replace fail if there is no matching file, or should it
> be treated as an add?

I think add.

> Then there is the question of conditional updates based on datestamps.

Does every archive provide datestamps?

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


Mime
View raw message