Java

Java

Made by DeepSource

Empty zip file entries should not be created JAVA-S0038

Anti-pattern
Major

The code calls putNextEntry(), immediately followed by a call to closeEntry(). This results in an empty ZipFile entry.

The contents of the entry should be written to the ZipFile between the calls to putNextEntry() and closeEntry(). This may cause issues with other software that does not expect empty entries in zip files generated in such a way.

References