public class ZipUtils extends Object
| 构造器和说明 |
|---|
ZipUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
compression(String sourceDir)
普通压缩
|
static void |
compression(String sourceDir,
String zipFileDir,
String fileName)
普通压缩
|
static void |
compression(String sourceDir,
String zipFileDir,
String fileName,
String password)
密码压缩
|
static void |
compression(String sourceDir,
String zipFileDir,
String fileName,
String comment,
LevelEnum level,
VolumeSizeEnum volumeSize,
Boolean isDelete,
Charset encoding)
普通压缩
|
static void |
compression(String sourceDir,
String zipFileDir,
String fileName,
String comment,
LevelEnum level,
VolumeSizeEnum volumeSize,
Boolean isDelete,
Charset encoding,
String password)
密码压缩
|
static File |
decompression(String sourceFile,
String targetDir)
普通解压
|
static File |
decompression(String sourceFile,
String targetDir,
String password)
密码解压
|
public static File decompression(String sourceFile, String targetDir, String password) throws MsToolsException
sourceFile - 待解压文件targetDir - 解压目录password - 密码 null 不使用密码MsToolsException - 异常public static File decompression(String sourceFile, String targetDir) throws MsToolsException
sourceFile - 待解压文件targetDir - 解压目录MsToolsException - 异常public static void compression(String sourceDir) throws MsToolsException
sourceDir - 待压缩目录或文件MsToolsException - 如果压缩失败,抛出该异常public static void compression(String sourceDir, String zipFileDir, String fileName) throws MsToolsException
sourceDir - 待压缩目录或文件zipFileDir - 压缩文件保存目录 null 使用压缩目录父目录fileName - 压缩文件名(不含文件扩展名) null 使用压缩目录名MsToolsException - 如果压缩失败,抛出该异常public static void compression(String sourceDir, String zipFileDir, String fileName, String password) throws MsToolsException
sourceDir - 待压缩目录或文件zipFileDir - 压缩文件保存目录 null 使用压缩目录父目录fileName - 压缩文件名(不含文件扩展名) null 使用压缩目录名password - 密码 null 时使用无密码MsToolsException - 如果压缩失败,抛出该异常public static void compression(String sourceDir, String zipFileDir, String fileName, String comment, LevelEnum level, VolumeSizeEnum volumeSize, Boolean isDelete, Charset encoding, String password) throws MsToolsException
sourceDir - 待压缩目录或文件zipFileDir - 压缩文件保存目录 null 使用压缩目录父目录fileName - 压缩文件名(不含文件扩展名) null 使用压缩目录名comment - 压缩文件注释 允许 nulllevel - 压缩级别 null 时使用默认级别volumeSize - 卷大小 Must be between 64kB and about 4GB (depending on the JVM). null 时使用默认卷大小isDelete - 是否删除源文件 null 时使用 falseencoding - 编码 null 时使用 UTF-8password - 密码 null 时使用无密码MsToolsException - 如果压缩失败,抛出该异常public static void compression(String sourceDir, String zipFileDir, String fileName, String comment, LevelEnum level, VolumeSizeEnum volumeSize, Boolean isDelete, Charset encoding) throws MsToolsException
sourceDir - 待压缩目录或文件zipFileDir - 压缩文件保存目录 null 使用压缩目录父目录fileName - 压缩文件名(不含文件扩展名) null 使用压缩目录名comment - 压缩文件注释 允许 nulllevel - 压缩级别 null 时使用默认级别volumeSize - 卷大小 Must be between 64kB and about 4GB (depending on the JVM). null 时使用默认卷大小isDelete - 是否删除源文件 null 时使用 falseencoding - 编码 null 时使用 UTF-8MsToolsException - 如果压缩失败,抛出该异常Copyright © 2024. All rights reserved.