public class ZipUtil extends Object
Constructor and Description |
---|
ZipUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
extract(File zipFile,
File destDir)
Extract the contents of a zipfile to a directory.
|
static void |
extract(ZipFile zipFile,
File destDir)
Extract the contents of a zipfile to a directory.
|
static boolean |
isZipStream(InputStream in)
Test if an input stream is a zip input stream by checking the "magic number"
|
static void |
writeEntry(ZipFile zipFile,
ZipEntry entry,
File destDir)
Write an entry to a zip file.
|
public static boolean isZipStream(InputStream in) throws IOException
in
- input streamIOException
public static void extract(File zipFile, File destDir) throws IOException
zipFile
- the zip file to extractdestDir
- the destination directoryIOException
- when something untoward happens during the extraction processpublic static void extract(ZipFile zipFile, File destDir) throws IOException
zipFile
- the zip file to extractdestDir
- the destination directoryIOException
- when something untoward happens during the extraction processpublic static void writeEntry(ZipFile zipFile, ZipEntry entry, File destDir) throws IOException
zipFile
- the zip file to read fromentry
- the entry to processdestDir
- the file to write toIOException
- if the entry could not be processedCopyright © 2015-2022 Eclipse Foundation. All Rights Reserved.