On 20 May 2013 16:48, Stefan Bodewig <bode...@apache.org> wrote: > Hi, > > over in Ant land a bug was raised that points at a problem in ZipFile > (Commons Compress' zip package is a fork of Ant's code and I try to keep > them in sync). > > When an archive contains duplicate entries - which is totally valid in > ZIPs - ZipFile's getEntry can sometimes return ZipArchiveEntry instances > that will receive null for ZipFile's getInputStream. This is > COMPRESS-227 which contains the details of the problem. > > I've for now fixed it in trunk by ignoring all but the last entry od the > same name seen while parsing the central directory. I've chosen to pick > the last since this is what ZipFile used to do for duplicate entries > without extra fields anyway. > > There may be reasons to return only the first entry and there may even > be reasons to provide a different method that returned all entries of a > given name, something like > > List<ZipArchiveEntry> getEntries(String name) > > The later would require some more book-keeping but I don't think the > performance impact would be too big. > > Tools like InfoZIP's zip/unzip list all entries of a given name. > > Do you think it is worth it?
What do WinZip and Windows do? Are there any sample Zips with multiple entries? > Stefan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org