5.32.1 What can I use the ZipService for?

Many files available on the Internet and exchanged by email are distributed as zip file archives. Archives make it easy to group files and make transporting and copying those files faster. Because the zip file archive format is widely used, you can be assured that almost all recipients will be able to read and extract the contents.

On the down side, the files contained in an archive are not as readily available to the applications that may wish to use them, although modern operating systems such as Microsoft Windows and tools often provide built-in file system support for zip file archives.

Following are two examples of typical uses of zip file archives.

Exchanging files with associates and partners

There are more technologies today than ever for electronically exchanging business information with trading partners. Many, like EDI and web services, are well supported by accepted standards. However, for some requirements the complexity of these solutions is simply not justified.

A subsidiary company, for example, may have to report financial results to its parent on a regular basis. The information is contained in Excel files that are produced as part of the month-end processing for their finance application. Once all the required files have been produced, the application might invoke the ZipService to collect and compress the files into a single zip archive. The application could then invoke the SMTPMailService to send the zip archive to the recipient in the parent company as an email attachment.

Archiving infrequently used files

Often files are important even though they may be infrequently used. You might archive such files to a zip file either to save disk space or to facilitate transfer to other media for secure retention. When needed, you can extract the files from the archive again.

For some applications (especially for personal use) such archiving might be a manual process, probably using your favored graphical zip program.

In other applications you might wish to archive certain data according to defined retention requirements. A customer service application, for example, might have a facility to store documents related to a specific transaction. Very likely the documents are stored in a pre-defined directory structure that might include folders for years and months. A part of your month-end processing might be to calculate the names of the folders containing the documents for two years ago and to use the ZipService to archive those folders and files before removing them from the system.