|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openorb.util.ZipUtil
This class provides utilities to manage a zip file.
Constructor Summary | |
ZipUtil()
|
Method Summary | |
static void |
addZipFileToZip(java.util.zip.ZipEntry src_entry,
java.util.zip.ZipFile inputZip,
java.lang.String dst_name,
java.util.zip.ZipOutputStream outputZip)
This function adds a zip file entry to another zip. |
static void |
CloseZip(ZipHandle handle)
Close a zip file |
static boolean |
containsFile(ZipHandle handle,
java.lang.String file)
This function tests if a zip contains a file specified as parameter. |
static void |
copy(ZipHandle src,
ZipHandle dst,
java.lang.String[] no_copy_list)
Make a copy of a zip file. |
static ZipHandle |
CreateZip(java.lang.String name)
Create a zip file. |
static byte[] |
getFileContent(ZipHandle handle,
java.lang.String file)
Extract a file and return its contents. |
static void |
insert(java.lang.String src_name,
java.lang.String dst_name,
ZipHandle dest)
This function adds a file to a zip file. |
static ZipHandle |
OpenZip(java.lang.String name)
Open a zip file. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ZipUtil()
Method Detail |
public static ZipHandle CreateZip(java.lang.String name) throws java.io.IOException
name
- The name for the zip file to create.java.io.IOException
- When the FileOutputStream can not be created.public static ZipHandle OpenZip(java.lang.String name) throws java.io.IOException
name
- The name for the zip file to open.java.io.IOException
- ????.public static void CloseZip(ZipHandle handle) throws java.io.IOException
handle
- The handle of the zip file to create.java.io.IOException
- When the handle can't be closed.public static void insert(java.lang.String src_name, java.lang.String dst_name, ZipHandle dest) throws java.io.IOException
src_name
- The name of the source file.dst_name
- The name of the destination file.dest
- The handle of the zip file into which to insert the file.java.io.IOException
- When the file can't be inserted into the zip file.public static void addZipFileToZip(java.util.zip.ZipEntry src_entry, java.util.zip.ZipFile inputZip, java.lang.String dst_name, java.util.zip.ZipOutputStream outputZip) throws java.io.IOException
src_entry
- The entry in the source zip file.inputZip
- The source zip file.dst_name
- The name in the destination zip file.outputZip
- The output stream of the destination zip file.java.io.IOException
- When the source can't be read or the destination
can't be written.public static void copy(ZipHandle src, ZipHandle dst, java.lang.String[] no_copy_list) throws java.io.IOException
src
- The handle of the source zip file.dst
- The handle of the destination zip file.no_copy_list
- An array of filenames that should be left out
while copying.java.io.IOException
- When either the read or the write fails.public static boolean containsFile(ZipHandle handle, java.lang.String file)
handle
- The handle of the zip file to be tested.file
- The file to check the zip file for.public static byte[] getFileContent(ZipHandle handle, java.lang.String file)
handle
- The handle of the zip file.file
- The file to extract.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |