public class ZipFileForPlugin
extends java.lang.Object
| 构造器和说明 |
|---|
ZipFileForPlugin(java.io.File zipFile)
Creates a new Zip File Object with the input file.
|
ZipFileForPlugin(java.lang.String zipFile)
Creates a new Zip File Object with the given zip file path.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addFile(java.io.File sourceFile,
ZipParameters parameters)
Adds input source file to the zip file.
|
void |
addFiles(java.util.ArrayList sourceFileList,
ZipParameters parameters)
Adds the list of input files to the zip file.
|
void |
addFolder(java.io.File path,
ZipParameters parameters)
Adds the folder in the given file object to the zip file.
|
void |
addFolder(java.lang.String path,
ZipParameters parameters)
Adds the folder in the given path to the zip file.
|
void |
addStream(java.io.InputStream inputStream,
ZipParameters parameters)
Creates a new entry in the zip file and adds the content of the inputstream to the
zip file.
|
void |
createZipFile(java.util.ArrayList sourceFileList,
ZipParameters parameters)
Creates a zip file and adds the list of source file(s) to the zip file.
|
void |
createZipFile(java.util.ArrayList sourceFileList,
ZipParameters parameters,
boolean splitArchive,
long splitLength)
Creates a zip file and adds the list of source file(s) to the zip file.
|
void |
createZipFile(java.io.File sourceFile,
ZipParameters parameters)
Creates a zip file and adds the source file to the zip file.
|
void |
createZipFile(java.io.File sourceFile,
ZipParameters parameters,
boolean splitArchive,
long splitLength)
Creates a zip file and adds the source file to the zip file.
|
void |
createZipFileFromFolder(java.io.File folderToAdd,
ZipParameters parameters,
boolean splitArchive,
long splitLength)
Creates a zip file and adds the files/folders from the specified folder to the zip file.
|
void |
createZipFileFromFolder(java.lang.String folderToAdd,
ZipParameters parameters,
boolean splitArchive,
long splitLength)
Creates a zip file and adds the files/folders from the specified folder to the zip file.
|
void |
extractAll(java.lang.String destPath)
Extracts all the files in the given zip file to the input destination path.
|
void |
extractAll(java.lang.String destPath,
UnzipParameters unzipParameters)
Extracts all the files in the given zip file to the input destination path.
|
void |
extractFile(FileHeader fileHeader,
java.lang.String destPath)
Extracts a specific file from the zip file to the destination path.
|
void |
extractFile(FileHeader fileHeader,
java.lang.String destPath,
UnzipParameters unzipParameters)
Extracts a specific file from the zip file to the destination path.
|
void |
extractFile(FileHeader fileHeader,
java.lang.String destPath,
UnzipParameters unzipParameters,
java.lang.String newFileName)
Extracts a specific file from the zip file to the destination path.
|
void |
extractFile(java.lang.String fileName,
java.lang.String destPath)
Extracts a specific file from the zip file to the destination path.
|
void |
extractFile(java.lang.String fileName,
java.lang.String destPath,
UnzipParameters unzipParameters)
Extracts a specific file from the zip file to the destination path.
|
void |
extractFile(java.lang.String fileName,
java.lang.String destPath,
UnzipParameters unzipParameters,
java.lang.String newFileName)
Extracts a specific file from the zip file to the destination path.
|
java.lang.String |
getComment()
Returns the comment set for the Zip file
|
java.lang.String |
getComment(java.lang.String encoding)
Returns the comment set for the Zip file in the input encoding
|
java.io.File |
getFile()
Returns the File object of the zip file
|
FileHeader |
getFileHeader(java.lang.String fileName)
Returns FileHeader if a file header with the given fileHeader
string exists in the zip model: If not returns null
|
java.util.List |
getFileHeaders()
Returns the list of file headers in the zip file.
|
ZipInputStream |
getInputStream(FileHeader fileHeader)
Returns an input stream for reading the contents of the Zip file corresponding
to the input FileHeader.
|
ProgressMonitor |
getProgressMonitor() |
java.util.ArrayList |
getSplitZipFiles()
Returns the full file path+names of all split zip files
in an ArrayList.
|
boolean |
isEncrypted()
Checks to see if the zip file is encrypted
|
boolean |
isRunInThread() |
boolean |
isSplitArchive()
Checks if the zip file is a split archive
|
boolean |
isValidZipFile()
Checks to see if the input zip file is a valid zip file.
|
void |
mergeSplitFiles(java.io.File outputZipFile)
Merges split zip files into a single zip file without the need to extract the
files in the archive
|
void |
removeFile(FileHeader fileHeader)
Removes the file provided in the input file header from the zip file.
|
void |
removeFile(java.lang.String fileName)
Removes the file provided in the input paramters from the zip file.
|
void |
setComment(java.lang.String comment)
Sets comment for the Zip file
|
void |
setFileNameCharset(java.lang.String charsetName)
Zip4j will encode all the file names with the input charset.
|
void |
setPassword(char[] password)
Sets the password for the zip file
|
void |
setPassword(java.lang.String password)
Sets the password for the zip file.
|
void |
setRunInThread(boolean runInThread) |
public ZipFileForPlugin(java.lang.String zipFile)
throws ZipException
zipFile - ZipExceptionpublic ZipFileForPlugin(java.io.File zipFile)
throws ZipException
zipFile - ZipExceptionpublic void createZipFile(java.io.File sourceFile,
ZipParameters parameters)
throws ZipException
sourceFile - - File to be added to the zip fileparameters - - parameters to create the zip fileZipExceptionpublic void createZipFile(java.io.File sourceFile,
ZipParameters parameters,
boolean splitArchive,
long splitLength)
throws ZipException
sourceFile - - File to be added to the zip fileparameters - - parameters to create the zip filesplitArchive - - if archive has to be split or notsplitLength - - if archive has to be split, then length in bytes at which it has to be splitZipExceptionpublic void createZipFile(java.util.ArrayList sourceFileList,
ZipParameters parameters)
throws ZipException
sourceFileList - - File to be added to the zip fileparameters - - parameters to create the zip fileZipExceptionpublic void createZipFile(java.util.ArrayList sourceFileList,
ZipParameters parameters,
boolean splitArchive,
long splitLength)
throws ZipException
sourceFileList - - File to be added to the zip fileparameters - - zip parameters for this file listsplitArchive - - if archive has to be split or notsplitLength - - if archive has to be split, then length in bytes at which it has to be splitZipExceptionpublic void createZipFileFromFolder(java.lang.String folderToAdd,
ZipParameters parameters,
boolean splitArchive,
long splitLength)
throws ZipException
folderToAdd - parameters - splitArchive - splitLength - ZipExceptionpublic void createZipFileFromFolder(java.io.File folderToAdd,
ZipParameters parameters,
boolean splitArchive,
long splitLength)
throws ZipException
folderToAdd - parameters - splitArchive - splitLength - ZipExceptionpublic void addFile(java.io.File sourceFile,
ZipParameters parameters)
throws ZipException
sourceFile - - File to tbe added to the zip fileparameters - - zip parameters for this fileZipExceptionpublic void addFiles(java.util.ArrayList sourceFileList,
ZipParameters parameters)
throws ZipException
sourceFileList - parameters - ZipExceptionpublic void addFolder(java.lang.String path,
ZipParameters parameters)
throws ZipException
path - parameters - ZipExceptionpublic void addFolder(java.io.File path,
ZipParameters parameters)
throws ZipException
path - parameters - ZipExceptionpublic void addStream(java.io.InputStream inputStream,
ZipParameters parameters)
throws ZipException
inputStream - parameters - ZipExceptionpublic void extractAll(java.lang.String destPath)
throws ZipException
destPath - ZipExceptionpublic void extractAll(java.lang.String destPath,
UnzipParameters unzipParameters)
throws ZipException
destPath - unzipParameters - ZipExceptionpublic void extractFile(FileHeader fileHeader, java.lang.String destPath) throws ZipException
fileHeader - destPath - ZipExceptionpublic void extractFile(FileHeader fileHeader, java.lang.String destPath, UnzipParameters unzipParameters) throws ZipException
fileHeader - destPath - unzipParameters - ZipExceptionpublic void extractFile(FileHeader fileHeader, java.lang.String destPath, UnzipParameters unzipParameters, java.lang.String newFileName) throws ZipException
fileHeader - destPath - unzipParameters - newFileName - ZipExceptionpublic void extractFile(java.lang.String fileName,
java.lang.String destPath)
throws ZipException
fileName - destPath - ZipExceptionpublic void extractFile(java.lang.String fileName,
java.lang.String destPath,
UnzipParameters unzipParameters)
throws ZipException
fileName - destPath - unzipParameters - ZipExceptionpublic void extractFile(java.lang.String fileName,
java.lang.String destPath,
UnzipParameters unzipParameters,
java.lang.String newFileName)
throws ZipException
fileName - destPath - unzipParameters - newFileName - ZipExceptionpublic void setPassword(java.lang.String password)
throws ZipException
password - ZipExceptionpublic void setPassword(char[] password)
throws ZipException
password - ZipExceptionpublic java.util.List getFileHeaders()
throws ZipException
ZipExceptionpublic FileHeader getFileHeader(java.lang.String fileName) throws ZipException
fileName - ZipExceptionpublic boolean isEncrypted()
throws ZipException
ZipExceptionpublic boolean isSplitArchive()
throws ZipException
ZipExceptionpublic void removeFile(java.lang.String fileName)
throws ZipException
fileName - ZipExceptionpublic void removeFile(FileHeader fileHeader) throws ZipException
fileHeader - ZipExceptionpublic void mergeSplitFiles(java.io.File outputZipFile)
throws ZipException
outputZipFile - ZipExceptionpublic void setComment(java.lang.String comment)
throws ZipException
comment - ZipExceptionpublic java.lang.String getComment()
throws ZipException
ZipExceptionpublic java.lang.String getComment(java.lang.String encoding)
throws ZipException
encoding - ZipExceptionpublic void setFileNameCharset(java.lang.String charsetName)
throws ZipException
charsetName - ZipExceptionpublic ZipInputStream getInputStream(FileHeader fileHeader) throws ZipException
fileHeader - ZipExceptionpublic boolean isValidZipFile()
public java.util.ArrayList getSplitZipFiles()
throws ZipException
ZipExceptionpublic ProgressMonitor getProgressMonitor()
public boolean isRunInThread()
public void setRunInThread(boolean runInThread)
public java.io.File getFile()