Package com.sun.enterprise.util.zip
Class ZipWriter
- java.lang.Object
-
- com.sun.enterprise.util.zip.ZipWriter
-
public class ZipWriter extends Object
-
-
Constructor Summary
Constructors Constructor Description ZipWriter(OutputStream outStream, String dirName, String[] fileList)
ZipWriter(String zipFilename, String dirName)
ZipWriter(String zipFilename, String dirName, ZipItem[] theItems)
ZipWriter(String zipFilename, String dirName, String[] fileList)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
excludeDirs(String[] dirs)
Exclude any files that are under these directories.void
excludeDirsAnywhere(String[] dirs)
Exclude any files that are under these directories.static void
main(String[] args)
void
safeWrite()
Does not throw an exception when there is a duplicate zip entry.void
write()
-
-
-
Constructor Detail
-
ZipWriter
public ZipWriter(String zipFilename, String dirName) throws ZipFileException
- Throws:
ZipFileException
-
ZipWriter
public ZipWriter(String zipFilename, String dirName, ZipItem[] theItems) throws ZipFileException
- Throws:
ZipFileException
-
ZipWriter
public ZipWriter(String zipFilename, String dirName, String[] fileList) throws ZipFileException
- Throws:
ZipFileException
-
ZipWriter
public ZipWriter(OutputStream outStream, String dirName, String[] fileList) throws ZipFileException
- Throws:
ZipFileException
-
-
Method Detail
-
excludeDirs
public void excludeDirs(String[] dirs)
Exclude any files that are under these directories. E.g. suppose you have C:/temp/x1, C:/temp/x2 and C:/temp/x3 and the root is set to c:temp. Then to exclude the contents of the second 2 dirs you would send in a String array with "x2" and "x3"- Parameters:
dirs
- an array of top-level directory names
-
excludeDirsAnywhere
public void excludeDirsAnywhere(String[] dirs)
Exclude any files that are under these directories. In this case if the dir name matches with ANY directory anywhere in the path -- exclude it. E.g. say you don't want to copy /a/b/c/osgi-cache/*.* then simply call this method with one of the dirs equal to "osgi-cache"- Parameters:
dirs
- an array of directory names- Since:
- 4.0
-
safeWrite
public void safeWrite() throws ZipFileException
Does not throw an exception when there is a duplicate zip entry.- Throws:
ZipFileException
- if an error while creating the archive
-
write
public void write() throws ZipFileException
- Throws:
ZipFileException
-
main
public static void main(String[] args)
-
-