@Scriptable
public final class ZipHelper
extends java.lang.Object
Constructor and Description |
---|
ZipHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
unzipDir(java.io.File p_fileZip,
java.io.File p_dirDst)
Extract a ZIP archive to a directory.
|
static void |
unzipDir(java.io.File p_zip,
java.io.File p_dirDst,
java.lang.String p_strEncoding) |
static void |
unzipDir(org.apache.tools.zip.ZipFile p_zipFile,
java.io.File p_dirDst) |
static void |
unzipDir(java.util.zip.ZipFile p_zip,
java.lang.String p_strRootDir,
java.io.File p_dirDst)
This method calls
unzipDir(ZipFile, String, File, Progress) with
a null progress parameter. |
static boolean |
unzipDir(java.util.zip.ZipFile p_zip,
java.lang.String p_strRootDir,
java.io.File p_dirDst,
de.uplanet.util.Progress p_progress)
Copy a directory recursively from a ZIP file.
p_dirDst is the parent directory of the new directory. |
static void |
unzipDir(java.util.zip.ZipInputStream p_zip,
java.lang.String p_strPrefixFilter,
java.io.File p_dirDst)
Extract a ZIP stream into a directory.
|
static void |
zipDir(java.io.File p_fileZip,
java.io.File p_dirSrc)
Copy a directory recursively to a ZIP file.
|
static void |
zipDir(java.util.zip.ZipOutputStream p_zip,
java.lang.String p_strRootDir,
java.io.File p_dirSrc)
Copy a directory recursively to a ZIP output stream.
|
static void |
zipDir(java.util.zip.ZipOutputStream p_zip,
java.lang.String p_strRootDir,
java.io.File p_dirSrc,
boolean p_bZipMarkedDirs,
java.util.Set<java.io.File> p_filesToExclude)
Copy a directory recursively to a ZIP output stream.
|
public static void zipDir(java.io.File p_fileZip, java.io.File p_dirSrc) throws java.io.IOException
p_fileZip
- The output file.p_dirSrc
- The directory to be archived.java.io.IOException
- If an I/O-error occurs.public static void zipDir(java.util.zip.ZipOutputStream p_zip, java.lang.String p_strRootDir, java.io.File p_dirSrc) throws java.io.IOException
p_zip
- A ZIP output stream.p_strRootDir
- The root directory for the added files, or null, if top level.p_dirSrc
- The directory to copy.java.io.IOException
- If an I/O-error occurs.public static void zipDir(java.util.zip.ZipOutputStream p_zip, java.lang.String p_strRootDir, java.io.File p_dirSrc, boolean p_bZipMarkedDirs, java.util.Set<java.io.File> p_filesToExclude) throws java.io.IOException
p_dest
is the parent directory of the new directory.
p_zip
- The ZIP output stream.p_strRootDir
- The root directory for the added files, or null, if top level.p_dirSrc
- The directory to copy.p_bZipMarkedDirs
- Zips directories, even if they are marked with a ".noexport" file.
If this parameter is set to false, the destination directory entry is created with a .noxexport entry
as the only content.p_filesToExclude
- Files to exclude
parameter is set to false
, the directory is exported as it would be empty.java.io.IOException
- If an I/O-error occurs.public static void unzipDir(java.util.zip.ZipInputStream p_zip, java.lang.String p_strPrefixFilter, java.io.File p_dirDst) throws java.io.IOException
p_zip
- The stream to be uzipped.p_strPrefixFilter
- A prefix for the files that are to be extracted, or null
if all files should be extracted. Forward slashes are used as path delimiters.p_dirDst
- The destination directory.java.io.IOException
- If an I/O-error occurs.public static void unzipDir(java.io.File p_fileZip, java.io.File p_dirDst) throws java.io.IOException
p_fileZip
- The file to be uzipped.p_dirDst
- The destination directory.java.io.IOException
- If an I/O-error occurs.public static void unzipDir(java.io.File p_zip, java.io.File p_dirDst, java.lang.String p_strEncoding) throws java.io.IOException
java.io.IOException
public static void unzipDir(org.apache.tools.zip.ZipFile p_zipFile, java.io.File p_dirDst) throws java.io.IOException
java.io.IOException
public static void unzipDir(java.util.zip.ZipFile p_zip, java.lang.String p_strRootDir, java.io.File p_dirDst) throws java.io.IOException
unzipDir(ZipFile, String, File, Progress)
with
a null
progress parameter.p_zip
- The file to be uzipped.p_strRootDir
- The root dir of the files in the zip, or null
, if top level.p_dirDst
- The destination directory.java.io.IOException
- If an I/O-error occurs.public static boolean unzipDir(java.util.zip.ZipFile p_zip, java.lang.String p_strRootDir, java.io.File p_dirDst, de.uplanet.util.Progress p_progress) throws java.io.IOException
p_dirDst
is the parent directory of the new directory.p_zip
- The file to be uzipped.p_strRootDir
- The root dir of the files in the zip, or null
, if top level.p_dirDst
- The destination directory.p_progress
- The progress callback to be used. May be null
.java.io.IOException
- If an I/O-error occurs.