ZipOutputStream & directories

Lance Andersen lance.andersen at oracle.com
Mon Mar 6 20:05:50 UTC 2023



On Mar 6, 2023, at 2:44 PM, Alan Bateman <Alan.Bateman at oracle.com<mailto:Alan.Bateman at oracle.com>> wrote:

On 06/03/2023 19:16, Lance Andersen wrote:
:

So I guess I do not see a huge downside, however we might want to look at a property to adjust in the unlikely event the unexpected occurs?

Alan thoughts?

Yeah, the jar tool does the right thing and writes directories entries with the STORED method and a size of 0.

Eirik's mail mentions that 7% of Spring Petclinic dependences are directories. It might be interesting to dig into that to see how they are generated, is it mostly maven-jar-plugin and if so, which APIs is it using?

Changing ZOS.putNextEntry to ignore the method/size provided by the caller would change long standing behavior, and Hyrum's Law has it that somebody will notice. This may be something for an API note rather than an implementation change.

That is what I was thinking  (once bitten twice shy).   I agree an API note is probably best

Best
Lance

-Alan

[cid:E1C4E2F0-ECD0-4C9D-ADB4-B16CA7BCB7FC at home]






Lance Andersen | Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com<mailto:Lance.Andersen at oracle.com>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20230306/3d938100/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oracle_sig_logo.gif
Type: image/gif
Size: 658 bytes
Desc: oracle_sig_logo.gif
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20230306/3d938100/oracle_sig_logo-0001.gif>


More information about the core-libs-dev mailing list