public class ZipFile
extends java.lang.Object
| Constructor and Description |
|---|
ZipFile(java.lang.String sourceZipFileName)
Creates a new instance of ZipFile
|
ZipFile(java.lang.String sourceZipFileName,
boolean createNewFile)
Open a new or existing zip file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFile(java.lang.String pathAndFileName,
java.lang.String entryName) |
void |
addFile(java.lang.String pathAndFileName,
java.lang.String entryName,
java.lang.String comment) |
void |
closeZip()
Must call this when zipping is completed.
|
static void |
copyFiles(ZipFileReader zr,
ZipFileWriter zw) |
void |
openZip(java.lang.String sourceZipFileName,
boolean createNewFile)
Open a new or existing zip file.
|
public ZipFile(java.lang.String sourceZipFileName)
throws java.lang.Exception
java.lang.Exceptionpublic ZipFile(java.lang.String sourceZipFileName,
boolean createNewFile)
throws java.lang.Exception
sourceZipFileName - is the name of a new or existing zip file.createNewFile - if set true will overwrite any existing filejava.lang.Exception - on detection of an errorpublic void openZip(java.lang.String sourceZipFileName,
boolean createNewFile)
throws java.lang.Exception
sourceZipFileName - is the name of a new or existing zip file.createNewFile - if set true will overwrite any existing filejava.lang.Exception - on detection of an errorpublic void addFile(java.lang.String pathAndFileName,
java.lang.String entryName)
throws java.lang.Exception
pathAndFileName - is the location of the file to insert into the zip fileentryName - is an optional name that will be used instead of the pathAndFileName
if it's not nulljava.lang.Exceptionpublic void addFile(java.lang.String pathAndFileName,
java.lang.String entryName,
java.lang.String comment)
throws java.lang.Exception
pathAndFileName - is the location of the file to insert into the zip fileentryName - is an optional name that will be used instead of the pathAndFileName
if it's not nullcomment - - will be added to the ZipEntry if not nulljava.lang.Exceptionpublic void closeZip()
throws java.lang.Exception
java.lang.Exceptionpublic static void copyFiles(ZipFileReader zr, ZipFileWriter zw) throws java.io.IOException
java.io.IOException