How can I create a zip file from a set of files?
Author: Deron Eriksson
Description: This Java tutorial describes how to create a zip file from a set of files.
Tutorial created using: Windows XP || JDK 1.5.0_09 || Eclipse Web Tools Platform 2.0 (Eclipse 3.3.0)


Page: < 1 2

(Continued from page 1)

The execution of ZipFiles is shown below in the Console view:

Execution of ZipFiles

The atest.zip file has been created at the root level of our project, as expected.

atest.zip file created

If we examine the contents of atest.zip, we can see that the zip file that we created contains the expected files.

atest.zip contents viewed with WinZip
Page: < 1 2