public class ZipParameters extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ZipParameters.SymbolicLinkAction
Indicates the action to take when a symbolic link is added to the ZIP file
|
Constructor and Description |
---|
ZipParameters()
Create a ZipParameters instance with default values;
CompressionMethod.DEFLATE, CompressionLevel.NORMAL, EncryptionMethod.NONE,
AesKeyStrength.KEY_STRENGTH_256, AesVerson.Two, SymbolicLinkAction.INCLUDE_LINKED_FILE_ONLY,
readHiddenFiles is true, readHiddenFolders is true, includeRootInFolder is true,
writeExtendedLocalFileHeader is true, overrideExistingFilesInZip is true
|
ZipParameters(ZipParameters zipParameters)
Create a clone of given ZipParameters instance
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
AesKeyStrength |
getAesKeyStrength()
Get the key strength of the AES encryption key
|
AesVersion |
getAesVersion()
Get the AES format version used for encryption
|
CompressionLevel |
getCompressionLevel()
Get the compression level used to compress files
|
CompressionMethod |
getCompressionMethod()
Get the compression method specified in this ZipParameters
|
String |
getDefaultFolderPath() |
EncryptionMethod |
getEncryptionMethod()
Get the encryption method used to encrypt files
|
long |
getEntryCRC() |
long |
getEntrySize() |
ExcludeFileFilter |
getExcludeFileFilter()
Returns the file exclusion filter that is currently being used when adding files/folders to zip file
|
String |
getFileComment()
Get the file comment
|
String |
getFileNameInZip() |
long |
getLastModifiedFileTime()
Get the last modified time to be used for files written to the ZIP
|
String |
getRootFolderNameInZip() |
ZipParameters.SymbolicLinkAction |
getSymbolicLinkAction()
Get the behavior when adding a symbolic link
|
boolean |
isEncryptFiles()
Test if files files are to be encrypted
|
boolean |
isIncludeRootFolder()
Test if the parent folder of the added files will be included in the ZIP
|
boolean |
isOverrideExistingFilesInZip() |
boolean |
isReadHiddenFiles()
Test if hidden files will be included during folder recursion
|
boolean |
isReadHiddenFolders()
Test if hidden folders will be included during folder recursion
|
boolean |
isUnixMode()
Returns true if zip4j is using unix mode as default.
|
boolean |
isWriteExtendedLocalFileHeader() |
void |
setAesKeyStrength(AesKeyStrength aesKeyStrength)
Set the key strength of the AES encryption key
|
void |
setAesVersion(AesVersion aesVersion)
Set the AES format version to use for encryption
|
void |
setCompressionLevel(CompressionLevel compressionLevel)
Set the compression level used to compress files
|
void |
setCompressionMethod(CompressionMethod compressionMethod)
Set the ZIP compression method
|
void |
setDefaultFolderPath(String defaultFolderPath) |
void |
setEncryptFiles(boolean encryptFiles)
Set the flag indicating that files are to be encrypted
|
void |
setEncryptionMethod(EncryptionMethod encryptionMethod)
Set the encryption method used to encrypt files
|
void |
setEntryCRC(long entryCRC) |
void |
setEntrySize(long entrySize) |
void |
setExcludeFileFilter(ExcludeFileFilter excludeFileFilter)
Set a filter to exclude any files from the list of files being added to zip.
|
void |
setFileComment(String fileComment)
Set the file comment
|
void |
setFileNameInZip(String fileNameInZip)
Set the filename that will be used to include a file into the ZIP file to a different name
that given by the source filename added to the ZIP file.
|
void |
setIncludeRootFolder(boolean includeRootFolder)
Set the flag to indicate if the parent folder of added files will be included in the ZIP
|
void |
setLastModifiedFileTime(long lastModifiedFileTime)
Set the last modified time recorded in the ZIP file for the added files.
|
void |
setOverrideExistingFilesInZip(boolean overrideExistingFilesInZip)
Set the behavior if a file is added that already exists in the ZIP.
|
void |
setReadHiddenFiles(boolean readHiddenFiles)
Indicate if hidden files will be included during folder recursion
|
void |
setReadHiddenFolders(boolean readHiddenFolders)
Indicate if hidden folders will be included during folder recursion
|
void |
setRootFolderNameInZip(String rootFolderNameInZip)
Set the folder name that will be prepended to the filename in the ZIP.
|
void |
setSymbolicLinkAction(ZipParameters.SymbolicLinkAction symbolicLinkAction)
Set the behavior when adding a symbolic link
|
void |
setUnixMode(boolean unixMode)
When set to true, zip4j uses unix mode as default when generating file headers.
|
void |
setWriteExtendedLocalFileHeader(boolean writeExtendedLocalFileHeader) |
public ZipParameters()
public ZipParameters(ZipParameters zipParameters)
zipParameters
- the ZipParameters instance to clonepublic CompressionMethod getCompressionMethod()
public void setCompressionMethod(CompressionMethod compressionMethod)
compressionMethod
- the ZIP compression methodpublic boolean isEncryptFiles()
public void setEncryptFiles(boolean encryptFiles)
encryptFiles
- if true, files will be encryptedpublic EncryptionMethod getEncryptionMethod()
public void setEncryptionMethod(EncryptionMethod encryptionMethod)
encryptionMethod
- the encryption method to be usedpublic CompressionLevel getCompressionLevel()
public void setCompressionLevel(CompressionLevel compressionLevel)
compressionLevel
- the compression level used to compress filespublic boolean isReadHiddenFiles()
public void setReadHiddenFiles(boolean readHiddenFiles)
readHiddenFiles
- if true, hidden files will be included when adding folders to the zippublic boolean isReadHiddenFolders()
public void setReadHiddenFolders(boolean readHiddenFolders)
readHiddenFolders
- if true, hidden folders will be included when added folders to the zippublic Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public AesKeyStrength getAesKeyStrength()
public void setAesKeyStrength(AesKeyStrength aesKeyStrength)
aesKeyStrength
- the key strength of the AES encryption keypublic AesVersion getAesVersion()
public void setAesVersion(AesVersion aesVersion)
aesVersion
- the AES format version to usepublic boolean isIncludeRootFolder()
public void setIncludeRootFolder(boolean includeRootFolder)
includeRootFolder
- if true, the parent folder of added files will be included in the ZIPpublic long getEntryCRC()
public void setEntryCRC(long entryCRC)
public String getDefaultFolderPath()
public void setDefaultFolderPath(String defaultFolderPath)
public String getFileNameInZip()
public void setFileNameInZip(String fileNameInZip)
fileNameInZip
- the filename to set in the ZIP. Use null or an empty String to set the default behaviorpublic long getLastModifiedFileTime()
public void setLastModifiedFileTime(long lastModifiedFileTime)
lastModifiedFileTime
- the last modified time in milliseconds since the epochpublic long getEntrySize()
public void setEntrySize(long entrySize)
public boolean isWriteExtendedLocalFileHeader()
public void setWriteExtendedLocalFileHeader(boolean writeExtendedLocalFileHeader)
public boolean isOverrideExistingFilesInZip()
public void setOverrideExistingFilesInZip(boolean overrideExistingFilesInZip)
overrideExistingFilesInZip
- if true, remove the existing file in the ZIP; if false do not add the new filepublic String getRootFolderNameInZip()
public void setRootFolderNameInZip(String rootFolderNameInZip)
rootFolderNameInZip
- the name of the folder to be prepended to the filename
in the ZIP archivepublic String getFileComment()
public void setFileComment(String fileComment)
fileComment
- the file commentpublic ZipParameters.SymbolicLinkAction getSymbolicLinkAction()
public void setSymbolicLinkAction(ZipParameters.SymbolicLinkAction symbolicLinkAction)
symbolicLinkAction
- the behavior when adding a symbolic linkpublic ExcludeFileFilter getExcludeFileFilter()
public void setExcludeFileFilter(ExcludeFileFilter excludeFileFilter)
public boolean isUnixMode()
public void setUnixMode(boolean unixMode)
unixMode
- Copyright © 2021. All rights reserved.