Package ca.spatial.util
Class Zip
java.lang.Object
ca.spatial.util.Zip
A simple zip file writer. This class provides a means to
write files and directories to Zip files.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Zip
Create an output Zip file of the specified name- Parameters:
filename
- the name of the output zip file to create- Throws:
IOException
- if an error occurs while creating the output file
-
-
Method Details
-
add
Write an entry to the Zip file. If this is a directory it will be recursively added.- Parameters:
name
- The name of the file to add.- Throws:
IOException
- if an error occurs while adding the element
-
add
Write an entry to the Zip file. If this is a directory it will be recursively added. Change directory to 'parent' before adding files.- Parameters:
parent
- the parent file namename
- the file name to add- Throws:
IOException
- if an error occurs while adding the element
-
close
Close the Zip file.- Throws:
IOException
- if an error occurs while adding the element
-
main
Create a zip file. The first argument is the the name of the Zip archive. Subsequent arguments are the names of the files to be included in the archive.- Parameters:
args
- the arguments to pass in to the program.
-