| Zip Postal Codes | Nesting |
| Zip File Format | GZIP vs Zip |
| Gotchas | Encryption |
| Writing | Learning More |
| Reading | Links |
| Directories |
PKZIP and Winzip use / as the directory separator character. It is up to you to convert the \ to / in element names for the ZipEntry write, and back again on read. If you don’t bother, the \ will get in the zip file, and you will have a platform-dependent zip.
Apache VFS gives you a common API for files that works both for regular files and zip file members. Normally you do your work with ZipFile, ZipEntry. ZipInputStream and ZipOutputStream or for simpler takes GZIPInputStream and GZIPOutputStream.
There are three approaches to the problem:
Inside zip files, dates and times are stored in local time in 16 bits each using an old MS DOS format. Bit 0 is the least signicant bit. The format is little-endian. There was not room in 16 bit to accurately represent time even to the second, so the seconds field contains the seconds divided by two, giving accuracy only to the even second.
To make matters worse, Standard tools like WinZip or PKZIP will always round the time up to the next even second when they restore, thereby possibly making the file one second younger. The JDK (i.e. javaToDosTime in ZipEntry rounds the time down, thereby making the file one second older.
|
| ||||||||||||||||||||||||||||||||||||||||
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.18] | ![]() | ||
| You are visitor number 35,365. | |||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/Mindprod website mirror) | ||
| http://mindprod.com/jgloss/zip.html | J:\mindprod\jgloss\zip.html | ||