|
Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
|
The ZipIo class makes it possible for the web server to work with resources in a ZIP file as if the ZIP file is a read-only file system.
The most common archive format, ZIP-File, is an "archive" that can contain one or more files. Usually the files "archived" in a ZIP-File are compressed to save space.
A ZIP-File contains a central repository, which stores the original directory structure that was archived. You can think of the central repository as a "read only" file system. The ZipIo class can decode and interpret the central repository in a ZIP-File.
The ZipIo class can automatically convert the internal ZIP data to a GZIP file without using an uncompressing library. Many browsers support the GZIP format and a file inside a ZIP-File can easily be transformed into a GZIP file.
An HTTP resource reader can use ZipIo's gzip resource interface to wrap deflated entries in gzip framing when the client accepts gzip. ZipIo itself provides file access; it does not send HTTP responses.
A decompression library is needed to read deflated entries as ordinary uncompressed bytes, including through HttpResponse::include. See Server Side Include files in the user manual for more information.
It is possible to create a non compressed ZIP file, which can be used without the aforementioned restrictions. A non compressed ZIP file is created by running: zip -0 args. See ZIP man page for more info. On windows, open a bash shell (Cygwin) and type one of:
info zip
zip -h
Directory and file names in the ZIP file must be stored as ASCII or UTF8.
A ZIP-File can be made plug-able; that is, you can add and remove a Zip-File from the virtual file system. The ZIP-File uses a ZipReader class, which inherits from CspReader, as the interface to the Zip-File. The example directory contains the FileZipReader which is an example implementation of a ZipReader.
#include <ZipIo.h>

Public Member Functions | |
| ZipIo () | |
| Uninitialized storage; call ZipIo_constructor before use. More... | |
| ZipIo (ZipReader *reader, size_t size=256, AllocatorIntf *alloc=0) | |
| ZipIo constructor. More... | |
| ~ZipIo () | |
| Notify an attached IoIntf, free the index/buffer/password storage, and leave the borrowed ZipReader and allocator alive. More... | |
| ZipErr | getECode () |
| Query construction status without performing I/O. More... | |
Additional Inherited Members | |
Public Attributes inherited from IoIntf | |
| IoIntf_Property | propertyFp |
| Set or get property. More... | |
| IoIntf_CloseDir | closeDirFp |
| Close directory. More... | |
| IoIntf_MkDir | mkDirFp |
| Make directory. More... | |
| IoIntf_Rename | renameFp |
| Rename resource. More... | |
| IoIntf_OpenDir | openDirFp |
| Open directory. More... | |
| IoIntf_OpenRes | openResFp |
| Open resource. More... | |
| IoIntf_OpenResGzip | openResGzipFp |
| Open file as a compressed gzip file. More... | |
| IoIntf_Remove | removeFp |
| Remove file. More... | |
| IoIntf_RmDir | rmDirFp |
| Remove directory. More... | |
| IoIntf_Stat | statFp |
| Get resource information. More... | |
| ZipIo::ZipIo | ( | ) |
Uninitialized storage; call ZipIo_constructor before use.