|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.util.ZipUtil
public abstract class ZipUtil
A set of utility methods for working with zip files.
| Nested Class Summary | |
|---|---|
static interface |
ZipUtil.ZipEntryVisitor
Used by walkZipFile(File, ZipEntryVisitor) to visit zip entries. |
| Method Summary | |
|---|---|
static void |
unzipFile(File zipFile,
File destDir)
Unzips the content of the given zip file to the specified directory. |
static void |
unzipFile(InputStream zipContent,
File outputDir)
Writes the zip content out to the specified directory. |
static void |
walkZipFile(File zipFile,
ZipUtil.ZipEntryVisitor visitor)
Walks the entries of a zip file, allowing a listener to "visit" each node and perform tasks on the zip entry. |
static void |
zipFileOrDirectory(File fileOrDirToZip,
File zipFile)
Zips up the given file or directory and stores the zip file at zipFile. |
static void |
zipFileOrDirectory(File fileOrDirToZip,
ZipOutputStream zos)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void zipFileOrDirectory(File fileOrDirToZip,
File zipFile)
throws IOException
zipFile.
Note that zipping up a directory and if the output zip file is to be located in or under
the directory being zipped, an exception will be thrown - you must output the zip file
in another location outside of the directory being zipped.
fileOrDirToZip - what to zip upzipFile - where to store the zip file
IOException
public static void zipFileOrDirectory(File fileOrDirToZip,
ZipOutputStream zos)
throws IOException
IOException
public static void unzipFile(File zipFile,
File destDir)
throws IOException
zipFile - the zip file to unzipdestDir - root directory where the zip files will be extracted
IOException - if any errors occur during the reading or writing
public static void unzipFile(InputStream zipContent,
File outputDir)
throws IOException
zipContent - stream containing the content to write; should be formatted as a ZIP fileoutputDir - root directory where the zip files will be extracted
IOException - if any errors occur during the reading or writing
public static void walkZipFile(File zipFile,
ZipUtil.ZipEntryVisitor visitor)
throws Exception
zipFile - the zip file to walkvisitor - the object that will be notified for each entry in the zip file
Exception - if any errors occur during the reading or visiting
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||