org.at4j.zip.builder
Class ZipBuilderSettings

java.lang.Object
  extended by org.at4j.zip.builder.ZipBuilderSettings

public class ZipBuilderSettings
extends Object

This object contains configuration for a 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.

Since:
1.0
Author:
Karl Gustafsson
See Also:
ZipBuilder

Field Summary
static String DEFAULT_FILE_COMMENT
          The default file comment.
 
Constructor Summary
ZipBuilderSettings()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FILE_COMMENT

public static final String DEFAULT_FILE_COMMENT
The default file comment.

See Also:
Constant Field Values
Constructor Detail

ZipBuilderSettings

public ZipBuilderSettings()
Method Detail

getDefaultFileEntrySettings

public ZipEntrySettings getDefaultFileEntrySettings()
Get the default settings for file entries.

Returns:
The default settings for file entries.

setDefaultFileEntrySettings

public ZipBuilderSettings setDefaultFileEntrySettings(ZipEntrySettings defaultFileEntrySettings)
Set the default settings for file entries.

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.

Parameters:
defaultFileEntrySettings - The new default settings for file entries.
Returns:
this

setCompressionLevel

public ZipBuilderSettings setCompressionLevel(CompressionLevel level)
Set the compression level for the default Zip file entry settings. This is a shortcut that may be used instead of setting the compression level on the default file ZipEntrySettings object's compression method property.

Parameters:
level - The compression level.
Returns:
this
Since:
1.0.2

getDefaultDirectoryEntrySettings

public ZipEntrySettings getDefaultDirectoryEntrySettings()
Get the default settings for directory entries.

Returns:
The default settings for directory entries.

setDefaultDirectoryEntrySettings

public ZipBuilderSettings setDefaultDirectoryEntrySettings(ZipEntrySettings defaultDirectoryEntrySettings)
Set the default settings for directory entries.

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.

Parameters:
defaultDirectoryEntrySettings - The new default settings for directory entries.
Returns:
this

getFileNameEncodingCharset

public Charset getFileNameEncodingCharset()
Get the charset to use for encoding file names in the archive.

Returns:
The charset to use for encoding file names in the archive.

setFileNameEncodingCharset

public ZipBuilderSettings setFileNameEncodingCharset(Charset fileNameEncodingCharset)
Set the charset to use for encoding file names in the archive.

Parameters:
fileNameEncodingCharset - The charset to use for encoding file names in the archive.
Returns:
this

getTextEncodingCharset

public Charset getTextEncodingCharset()
Get the charset to use for encoding text other than file names in the archive.

Returns:
The charset to use for encoding text other than file names in the archive.

setTextEncodingCharset

public ZipBuilderSettings setTextEncodingCharset(Charset textEncodingCharset)
Set the charset to use for encoding text other than file names in the archive.

Parameters:
textEncodingCharset - The charset to use for encoding text other than file names in the archive.
Returns:
this

getInternalFileAttributesStrategy

public InternalFileAttributesStrategy getInternalFileAttributesStrategy()
Get the internal file attributes strategy for creating the internal file attributes for the entries that are added to the archive.

Returns:
The internal file attributes strategy.

setInternalFileAttributesStrategy

public 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.

Parameters:
strat - The internal file attributes strategy.
Returns:
this

getFileComment

public String getFileComment()
Get the Zip file's comment.

Returns:
The Zip file's comment.

setFileComment

public ZipBuilderSettings setFileComment(String s)
Set the Zip file's comment.

Parameters:
s - The Zip files comment, or null if the file should not have a comment.
Returns:
this