程序包 dev.utils.common
类 ZipUtils
java.lang.Object
dev.utils.common.ZipUtils
detail: 压缩相关工具类
- 作者:
- Ttt
-
方法概要
修饰符和类型方法说明getComments(File zipFile) 获取压缩文件中的注释链表getComments(String zipFilePath) 获取压缩文件中的注释链表getFilesPath(File zipFile) 获取压缩文件中的文件路径链表getFilesPath(String zipFilePath) 获取压缩文件中的文件路径链表解压文件解压文件unzipFileByKeyword(File zipFile, File destDir, String keyword) 解压带有关键字的文件unzipFileByKeyword(String zipFilePath, String destDirPath, String keyword) 解压带有关键字的文件static boolean压缩文件static boolean压缩文件static boolean压缩文件static boolean压缩文件static booleanzipFiles(Collection<File> resFiles, File zipFile) 批量压缩文件static booleanzipFiles(Collection<File> resFiles, File zipFile, String comment) 批量压缩文件static booleanzipFiles(Collection<String> resFiles, String zipFilePath) 批量压缩文件static booleanzipFiles(Collection<String> resFilePaths, String zipFilePath, String comment) 批量压缩文件
-
方法详细资料
-
zipFiles
批量压缩文件- 参数:
resFiles- 待压缩文件路径集合zipFilePath- 压缩文件路径- 返回:
true压缩成功,false压缩失败- 抛出:
Exception- 异常时抛出
-
zipFiles
public static boolean zipFiles(Collection<String> resFilePaths, String zipFilePath, String comment) throws Exception 批量压缩文件- 参数:
resFilePaths- 待压缩文件路径集合zipFilePath- 压缩文件路径comment- 压缩文件的注释- 返回:
true压缩成功,false压缩失败- 抛出:
Exception- 异常时抛出
-
zipFiles
批量压缩文件- 参数:
resFiles- 待压缩文件集合zipFile- 压缩文件- 返回:
true压缩成功,false压缩失败- 抛出:
Exception- 异常时抛出
-
zipFiles
public static boolean zipFiles(Collection<File> resFiles, File zipFile, String comment) throws Exception 批量压缩文件- 参数:
resFiles- 待压缩文件集合zipFile- 压缩文件comment- 压缩文件的注释- 返回:
true压缩成功,false压缩失败- 抛出:
Exception- 异常时抛出
-
zipFile
压缩文件- 参数:
resFilePath- 待压缩文件路径zipFilePath- 压缩文件路径- 返回:
true压缩成功,false压缩失败- 抛出:
Exception- 异常时抛出
-
zipFile
public static boolean zipFile(String resFilePath, String zipFilePath, String comment) throws Exception 压缩文件- 参数:
resFilePath- 待压缩文件路径zipFilePath- 压缩文件路径comment- 压缩文件的注释- 返回:
true压缩成功,false压缩失败- 抛出:
Exception- 异常时抛出
-
zipFile
压缩文件- 参数:
resFile- 待压缩文件zipFile- 压缩文件- 返回:
true压缩成功,false压缩失败- 抛出:
Exception- 异常时抛出
-
zipFile
压缩文件- 参数:
resFile- 待压缩文件zipFile- 压缩文件comment- 压缩文件的注释- 返回:
true压缩成功,false压缩失败- 抛出:
Exception- 异常时抛出
-
unzipFile
解压文件- 参数:
zipFilePath- 待解压文件路径destDirPath- 目标目录路径- 返回:
- 文件链表
- 抛出:
Exception- 异常时抛出
-
unzipFile
解压文件- 参数:
zipFile- 待解压文件destDir- 目标目录- 返回:
- 文件链表
- 抛出:
Exception- 异常时抛出
-
unzipFileByKeyword
public static List<File> unzipFileByKeyword(String zipFilePath, String destDirPath, String keyword) throws Exception 解压带有关键字的文件- 参数:
zipFilePath- 待解压文件路径destDirPath- 目标目录路径keyword- 关键字- 返回:
- 带有关键字的文件链表
- 抛出:
Exception- 异常时抛出
-
unzipFileByKeyword
public static List<File> unzipFileByKeyword(File zipFile, File destDir, String keyword) throws Exception 解压带有关键字的文件- 参数:
zipFile- 待解压文件destDir- 目标目录keyword- 关键字- 返回:
- 带有关键字的文件链表
- 抛出:
Exception- 异常时抛出
-
getFilesPath
获取压缩文件中的文件路径链表- 参数:
zipFilePath- 压缩文件路径- 返回:
- 压缩文件中的文件路径链表
- 抛出:
Exception- 异常时抛出
-
getFilesPath
获取压缩文件中的文件路径链表- 参数:
zipFile- 压缩文件- 返回:
- 压缩文件中的文件路径链表
- 抛出:
Exception- 异常时抛出
-
getComments
获取压缩文件中的注释链表- 参数:
zipFilePath- 压缩文件路径- 返回:
- 压缩文件中的注释链表
- 抛出:
Exception- 异常时抛出
-
getComments
获取压缩文件中的注释链表- 参数:
zipFile- 压缩文件- 返回:
- 压缩文件中的注释链表
- 抛出:
Exception- 异常时抛出
-