Updating zip file java
The basedir attribute is the reference directory from where to zip.Note that file permissions will not be stored in the resulting zipfile.
If you wish to avoid this behavior you must set the .The ZIP file will only reflect the relative paths of files within each fileset.The Zip task and its derivatives know a special form of a fileset named zipfileset that has additional attributes (described below).This task will now use the platform's default character encoding for filenames - this is consistent with the command line ZIP tools, but causes problems if you try to open them from within Java and your filenames contain non US-ASCII characters.Use the encoding attribute and set it to UTF8 to create zip files that can safely be read by Java.With the includes or includesfile attribute you specify the files you want to have included by using patterns.
The exclude or excludesfile attribute is used to specify the files you want to have excluded. And finally with the defaultexcludes attribute, you can specify whether you want to use default exclusions or not.
Please also note that different ZIP tools handle timestamps differently when it comes to applying timezone offset calculations of files.
Some ZIP libraries will store the timestamps as they've been read from the filesystem while others will modify the timestamps both when reading and writing the files to make all timestamps use the same timezone.
This means that using the unzip task on files created by Windows' compressed folders function may create files with timestamps that are "wrong", the same is true if you use Windows' functions to extract an Ant generated ZIP archive.
The character encoding to use for filenames inside the zip file.
For a list of possible values see the Supported Encodings.