This has been documented as causing various problems for unsuspecting users.
If you wish to avoid this behavior you must set the .
They will be unusable with Windows' "compressed folders" feature and bigger than archives without the Unicode extra fields, though. Zip Output Stream; public class App package com.mkyong.zip; import Java, by default, does not provide any support for password protection for file; though it has very good API support for creating/extracting zip files. Please note that ZIP files store file modification times with a granularity of 2 seconds.If a file is less than 2 seconds newer than the entry in the archive, Apache Ant will not consider it newer.Zip64 extensions provide a way to create archives bigger than 4 GB or holding more than 65535 entries—or add individual entries bigger than 4 GB using the ZIP extension field mechanism.These extensions are supported by most modern ZIP implementations.To download the Zip4j library, go to its zip4j download page and download it’s latest version (zip4j_1.3.2till today). Now, you can use below code to create a password protected archive.import Zip4j Constants; public class Create Password Protected Zip Example There are other useful usecases, you can look into it’s source distribution [zip4j_examples_eclipse_1.3.2.zip] as well. Set this attribute to Traditionally the ZIP archive format uses Code Page 437 as encoding for file name, which is not sufficient for many international character sets.Over time different archivers have chosen different ways to work around the limitation—the , all zip, jar and similar archives written by Ant will set this flag, if the encoding has been set to UTF-8.