public class ZipBuilderSettings extends Object
ZipBuilder
. When a new
instance is created, it is initialized with the default settings.
The default file entry settings are:
Property | Value |
---|---|
Compression method | Deflate compression with default settings (
DeflatedCompressionMethod ) |
External file attributes | MS DOS external file attributes (
MsDosExternalFileAttributes ) with default file
attributes (
MsDosExternalFileAttributes.DEFAULT_FILE_ATTRIBUTES
– archive) |
Extra fields | No extra fields |
The default directory entry settings are:
Property | Value |
---|---|
External file attributes | MS DOS external file attributes (
MsDosExternalFileAttributes ) with default
directory attributes (
MsDosExternalFileAttributes.DEFAULT_DIRECTORY_ATTRIBUTES
– directory) |
Extra fields | No extra fields |
The platform's default Charset
is used for encoding text.
The setter methods of this object return the object instance so that setter calls can be chained together.
ZipBuilder
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FILE_COMMENT
The default file comment.
|
Constructor and Description |
---|
ZipBuilderSettings() |
Modifier and Type | Method and Description |
---|---|
ZipEntrySettings |
getDefaultDirectoryEntrySettings()
Get the default settings for directory entries.
|
ZipEntrySettings |
getDefaultFileEntrySettings()
Get the default settings for file entries.
|
String |
getFileComment()
Get the Zip file's comment.
|
Charset |
getFileNameEncodingCharset()
Get the charset to use for encoding file names in the archive.
|
InternalFileAttributesStrategy |
getInternalFileAttributesStrategy()
Get the internal file attributes strategy for creating the internal file
attributes for the entries that are added to the archive.
|
Charset |
getTextEncodingCharset()
Get the charset to use for encoding text other than file names in the
archive.
|
ZipBuilderSettings |
setCompressionLevel(CompressionLevel level)
Set the compression level for the default Zip file entry settings.
|
ZipBuilderSettings |
setDefaultDirectoryEntrySettings(ZipEntrySettings defaultDirectoryEntrySettings)
Set the default settings for directory entries.
|
ZipBuilderSettings |
setDefaultFileEntrySettings(ZipEntrySettings defaultFileEntrySettings)
Set the default settings for file entries.
|
ZipBuilderSettings |
setFileComment(String s)
Set the Zip file's comment.
|
ZipBuilderSettings |
setFileNameEncodingCharset(Charset fileNameEncodingCharset)
Set the charset to use for encoding file names in the archive.
|
ZipBuilderSettings |
setInternalFileAttributesStrategy(InternalFileAttributesStrategy strat)
Set the internal file attributes strategy used for creating the internal
file attributes for the entries that are added to the archive.
|
ZipBuilderSettings |
setTextEncodingCharset(Charset textEncodingCharset)
Set the charset to use for encoding text other than file names in the
archive.
|
public static final String DEFAULT_FILE_COMMENT
public ZipEntrySettings getDefaultFileEntrySettings()
public ZipBuilderSettings setDefaultFileEntrySettings(ZipEntrySettings defaultFileEntrySettings)
This will be combined with the default default file entry settings, so it only has to contain the configuration delta compared with the default settings.
defaultFileEntrySettings
- The new default settings for file
entries.this
public ZipBuilderSettings setCompressionLevel(CompressionLevel level)
ZipEntrySettings
object's compression method
property.level
- The compression level.this
public ZipEntrySettings getDefaultDirectoryEntrySettings()
public ZipBuilderSettings setDefaultDirectoryEntrySettings(ZipEntrySettings defaultDirectoryEntrySettings)
This will be combined with the default default directory entry settings, so it only has to contain the configuration delta compared with the default settings.
defaultDirectoryEntrySettings
- The new default settings for
directory entries.this
public Charset getFileNameEncodingCharset()
public ZipBuilderSettings setFileNameEncodingCharset(Charset fileNameEncodingCharset)
fileNameEncodingCharset
- The charset to use for encoding file names
in the archive.this
public Charset getTextEncodingCharset()
public ZipBuilderSettings setTextEncodingCharset(Charset textEncodingCharset)
textEncodingCharset
- The charset to use for encoding text other
than file names in the archive.this
public InternalFileAttributesStrategy getInternalFileAttributesStrategy()
public ZipBuilderSettings setInternalFileAttributesStrategy(InternalFileAttributesStrategy strat)
strat
- The internal file attributes strategy.this
public String getFileComment()
public ZipBuilderSettings setFileComment(String s)
s
- The Zip files comment, or null
if the file should not
have a comment.this