public final class ZipUtils
extends java.lang.Object
author: Blankj blog : http://blankj.com time : 2016/08/27 desc : utils about zip or jar
限定符和类型 | 方法和说明 |
---|---|
static java.util.List<java.lang.String> |
getComments(java.io.File zipFile)
Return the files' comment in ZIP file.
|
static java.util.List<java.lang.String> |
getComments(java.lang.String zipFilePath)
Return the files' comment in ZIP file.
|
static java.util.List<java.lang.String> |
getFilesPath(java.io.File zipFile)
Return the files' path in ZIP file.
|
static java.util.List<java.lang.String> |
getFilesPath(java.lang.String zipFilePath)
Return the files' path in ZIP file.
|
static java.util.List<java.io.File> |
unzipFile(java.io.File zipFile,
java.io.File destDir)
Unzip the file.
|
static java.util.List<java.io.File> |
unzipFile(java.lang.String zipFilePath,
java.lang.String destDirPath)
Unzip the file.
|
static java.util.List<java.io.File> |
unzipFileByKeyword(java.io.File zipFile,
java.io.File destDir,
java.lang.String keyword)
Unzip the file by keyword.
|
static java.util.List<java.io.File> |
unzipFileByKeyword(java.lang.String zipFilePath,
java.lang.String destDirPath,
java.lang.String keyword)
Unzip the file by keyword.
|
static boolean |
zipFile(java.io.File srcFile,
java.io.File zipFile)
Zip the file.
|
static boolean |
zipFile(java.io.File srcFile,
java.io.File zipFile,
java.lang.String comment)
Zip the file.
|
static boolean |
zipFile(java.lang.String srcFilePath,
java.lang.String zipFilePath)
Zip the file.
|
static boolean |
zipFile(java.lang.String srcFilePath,
java.lang.String zipFilePath,
java.lang.String comment)
Zip the file.
|
static boolean |
zipFiles(java.util.Collection<java.io.File> srcFiles,
java.io.File zipFile)
Zip the files.
|
static boolean |
zipFiles(java.util.Collection<java.io.File> srcFiles,
java.io.File zipFile,
java.lang.String comment)
Zip the files.
|
static boolean |
zipFiles(java.util.Collection<java.lang.String> srcFiles,
java.lang.String zipFilePath)
Zip the files.
|
static boolean |
zipFiles(java.util.Collection<java.lang.String> srcFilePaths,
java.lang.String zipFilePath,
java.lang.String comment)
Zip the files.
|
public static boolean zipFiles(java.util.Collection<java.lang.String> srcFiles, java.lang.String zipFilePath) throws java.io.IOException
srcFiles
- The source of files.zipFilePath
- The path of ZIP file.true
: successfalse
: failjava.io.IOException
- if an I/O error has occurredpublic static boolean zipFiles(java.util.Collection<java.lang.String> srcFilePaths, java.lang.String zipFilePath, java.lang.String comment) throws java.io.IOException
srcFilePaths
- The paths of source files.zipFilePath
- The path of ZIP file.comment
- The comment.true
: successfalse
: failjava.io.IOException
- if an I/O error has occurredpublic static boolean zipFiles(java.util.Collection<java.io.File> srcFiles, java.io.File zipFile) throws java.io.IOException
srcFiles
- The source of files.zipFile
- The ZIP file.true
: successfalse
: failjava.io.IOException
- if an I/O error has occurredpublic static boolean zipFiles(java.util.Collection<java.io.File> srcFiles, java.io.File zipFile, java.lang.String comment) throws java.io.IOException
srcFiles
- The source of files.zipFile
- The ZIP file.comment
- The comment.true
: successfalse
: failjava.io.IOException
- if an I/O error has occurredpublic static boolean zipFile(java.lang.String srcFilePath, java.lang.String zipFilePath) throws java.io.IOException
srcFilePath
- The path of source file.zipFilePath
- The path of ZIP file.true
: successfalse
: failjava.io.IOException
- if an I/O error has occurredpublic static boolean zipFile(java.lang.String srcFilePath, java.lang.String zipFilePath, java.lang.String comment) throws java.io.IOException
srcFilePath
- The path of source file.zipFilePath
- The path of ZIP file.comment
- The comment.true
: successfalse
: failjava.io.IOException
- if an I/O error has occurredpublic static boolean zipFile(java.io.File srcFile, java.io.File zipFile) throws java.io.IOException
srcFile
- The source of file.zipFile
- The ZIP file.true
: successfalse
: failjava.io.IOException
- if an I/O error has occurredpublic static boolean zipFile(java.io.File srcFile, java.io.File zipFile, java.lang.String comment) throws java.io.IOException
srcFile
- The source of file.zipFile
- The ZIP file.comment
- The comment.true
: successfalse
: failjava.io.IOException
- if an I/O error has occurredpublic static java.util.List<java.io.File> unzipFile(java.lang.String zipFilePath, java.lang.String destDirPath) throws java.io.IOException
zipFilePath
- The path of ZIP file.destDirPath
- The path of destination directory.java.io.IOException
- if unzip unsuccessfullypublic static java.util.List<java.io.File> unzipFile(java.io.File zipFile, java.io.File destDir) throws java.io.IOException
zipFile
- The ZIP file.destDir
- The destination directory.java.io.IOException
- if unzip unsuccessfullypublic static java.util.List<java.io.File> unzipFileByKeyword(java.lang.String zipFilePath, java.lang.String destDirPath, java.lang.String keyword) throws java.io.IOException
zipFilePath
- The path of ZIP file.destDirPath
- The path of destination directory.keyword
- The keyboard.java.io.IOException
- if unzip unsuccessfullypublic static java.util.List<java.io.File> unzipFileByKeyword(java.io.File zipFile, java.io.File destDir, java.lang.String keyword) throws java.io.IOException
zipFile
- The ZIP file.destDir
- The destination directory.keyword
- The keyboard.java.io.IOException
- if unzip unsuccessfullypublic static java.util.List<java.lang.String> getFilesPath(java.lang.String zipFilePath) throws java.io.IOException
zipFilePath
- The path of ZIP file.java.io.IOException
- if an I/O error has occurredpublic static java.util.List<java.lang.String> getFilesPath(java.io.File zipFile) throws java.io.IOException
zipFile
- The ZIP file.java.io.IOException
- if an I/O error has occurredpublic static java.util.List<java.lang.String> getComments(java.lang.String zipFilePath) throws java.io.IOException
zipFilePath
- The path of ZIP file.java.io.IOException
- if an I/O error has occurredpublic static java.util.List<java.lang.String> getComments(java.io.File zipFile) throws java.io.IOException
zipFile
- The ZIP file.java.io.IOException
- if an I/O error has occurred