From ddf53853f8d25ea44fba4bbabcc382784ec8eed8 Mon Sep 17 00:00:00 2001 From: Felix Knecht Date: Thu, 27 Jun 2024 21:02:15 +0200 Subject: [PATCH] Document how to add an empty folder via ZipOutputStream --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index c886a92..dbbe84a 100644 --- a/README.md +++ b/README.md @@ -539,6 +539,15 @@ public class ZipInputStreamExample { } ``` +### Adding an empty folder with ZipOutputStream + +```java +// To add an empty folder to the zip, make sure the name ends with a / +zipParameters.setFileNameInZip("empty folder/"); +zipOutputStream.putNextEntry(zipParameters); +zipOutputStream.closeEntry(); +``` + ## Working with Progress Monitor ProgressMonitor makes it easier for applications (especially user facing) to integrate Zip4j. It is useful to show