类 ZipCodeCompressHandler
java.lang.Object
tech.mhuang.pacebox.core.compress.handler.ZipCodeCompressHandler
- 所有已实现的接口:
BaseCompressHandler,CodeCompressHandler
ZIP压缩解压类
- 从以下版本开始:
- 1.0.9
- 作者:
- yuanhang.huang
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidcompress(File sourcePath, OutputStream os) 源文件/文件夹压缩成流数据输出void压缩文件voiddecompress(String sourceFile, String destDir, boolean cover, boolean deep) 解压文件boolean压缩文件匹配检查voidzip解压voidzip解压void压缩文件voidzip(File sourcePath, FileOutputStream fos) 压缩文件voidzip(File sourcePath, OutputStream os) 压缩文件void压缩文件voidzipFile(File file, String zipPath, ZipOutputStream zos) 单文件压缩ZIPvoidzipFile(File file, ZipOutputStream zos) 单文件压缩ZIPvoidzipFiles(File[] files, ZipOutputStream zos) 多文件压缩ZIP
-
字段详细资料
-
构造器详细资料
-
ZipCodeCompressHandler
public ZipCodeCompressHandler()
-
-
方法详细资料
-
match
从接口复制的说明:BaseCompressHandler压缩文件匹配检查- 指定者:
match在接口中BaseCompressHandler- 参数:
fileName- 压缩文件名- 返回:
- 是否匹配成功
-
compress
从接口复制的说明:BaseCompressHandler压缩文件- 指定者:
compress在接口中BaseCompressHandler- 参数:
sourcePath- 源文件/文件夹destFile- 压缩文件cover- 覆盖文件- 抛出:
IOException- IO异常
-
decompress
public void decompress(String sourceFile, String destDir, boolean cover, boolean deep) throws IOException 从接口复制的说明:BaseCompressHandler解压文件- 指定者:
decompress在接口中BaseCompressHandler- 参数:
sourceFile- 源文件destDir- 解压目录cover- 覆盖文件deep- 深度压缩(递归)- 抛出:
IOException- IO异常
-
compress
从接口复制的说明:CodeCompressHandler源文件/文件夹压缩成流数据输出- 指定者:
compress在接口中CodeCompressHandler- 参数:
sourcePath- 源文件/文件夹os- 输出流- 抛出:
RuntimeException- RuntimeExceptionIOException- IOException
-
zip
public void zip(String sourcePath, String destFile, boolean cover) throws RuntimeException, IOException 压缩文件- 参数:
sourcePath- 源文件/文件夹destFile- 压缩文件cover- 覆盖原文件- 抛出:
RuntimeException- RuntimeExceptionIOException- IOException
-
zip
压缩文件- 参数:
sourcePath- 源文件/文件夹destFile- 压缩文件- 抛出:
RuntimeException- RuntimeExceptionIOException- IOException
-
zip
压缩文件- 参数:
sourcePath- 源文件/文件夹os- 输出流- 抛出:
RuntimeException- RuntimeExceptionIOException- IOException
-
zip
压缩文件- 参数:
sourcePath- 源文件/文件夹fos- 文件输出流- 抛出:
RuntimeException- RuntimeExceptionIOException- IOException
-
zipFiles
多文件压缩ZIP- 参数:
files- 需要压缩的文件列表zos- 压缩文件输出流- 抛出:
IOException- 压缩失败会抛出运行时异常
-
zipFile
单文件压缩ZIP- 参数:
file- 源文件zos- ZIP输出流- 抛出:
IOException- IOException
-
zipFile
单文件压缩ZIP- 参数:
file- 源文件zipPath- 压缩包内的路径zos- ZIP输出流- 抛出:
IOException- IOException
-
unZip
public void unZip(String sourceFile, String destDir, boolean cover, boolean deep) throws IOException zip解压- 参数:
sourceFile- zip源文件destDir- 解压后的目标文件夹cover- 覆盖文件deep- 深度解压(递归)- 抛出:
IOException- IO异常
-
unZip
zip解压- 参数:
sourceFile- zip源文件destDir- 解压后的目标文件夹cover- 覆盖文件deep- 深度解压(递归)- 抛出:
IOException- IOException
-