Enum PluginBundlePublisher.CompressionMethod
- java.lang.Object
-
- java.lang.Enum<PluginBundlePublisher.CompressionMethod>
-
- ca.cgjennings.apps.arkham.plugins.catalog.PluginBundlePublisher.CompressionMethod
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<PluginBundlePublisher.CompressionMethod>
- Enclosing class:
- PluginBundlePublisher
public static enum PluginBundlePublisher.CompressionMethod extends java.lang.Enum<PluginBundlePublisher.CompressionMethod>
An enumeration of the possible methods (algorithms) that may be used to compress plug-in bundles for network transport.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Compressor
createCompressor()
Create a compressor/decompressor for this compression type.static PluginBundlePublisher.CompressionMethod
forExtension(java.lang.String name)
Returns the compression method associated with the extension part of a file name in a string.static PluginBundlePublisher.CompressionMethod
getDefault()
Returns the default compression method for plug-in bundles.int
getMinimumBuildNumber()
Returns the first build number that supports this compression method.java.lang.String
getPublishedBundleExtension()
Returns the standard file name extension used by published bundles compressed with this method.static PluginBundlePublisher.CompressionMethod
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static PluginBundlePublisher.CompressionMethod[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BZIP2
public static final PluginBundlePublisher.CompressionMethod BZIP2
The BZip2 compression method (based on the Burrows–Wheeler algorithm). Typically, BZip2 yields the best compression ratio (smallest download), but decompression is significantly slower. Published bundles use extension ".pbz".
-
GZIP
public static final PluginBundlePublisher.CompressionMethod GZIP
The Gzip DEFLATE compression method (a combination of LZ77 and Huffman coding). Typically, Gzip yields the worst compression ratio (largest download), but decompresses very quickly. Published bundles use extension ".pgz".
-
LZMA
public static final PluginBundlePublisher.CompressionMethod LZMA
The LZMA (Lempel-Ziv-Markov chain) compression method. Typically, LZMA yields the bext compression ratio and faster decompression times than BZip2 (but still slower than than Gzip DEFLATE). Published bundles use extension ".plzm".
-
-
Method Detail
-
values
public static PluginBundlePublisher.CompressionMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PluginBundlePublisher.CompressionMethod c : PluginBundlePublisher.CompressionMethod.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PluginBundlePublisher.CompressionMethod valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getPublishedBundleExtension
public java.lang.String getPublishedBundleExtension()
Returns the standard file name extension used by published bundles compressed with this method.- Returns:
- the bundle extension used to identify the compression method
-
createCompressor
public Compressor createCompressor()
Create a compressor/decompressor for this compression type.- Returns:
- a new instance of a compressor that uses this compression method
-
getMinimumBuildNumber
public int getMinimumBuildNumber()
Returns the first build number that supports this compression method. Returns 0 if the compression method has "always" been available, that is, has been supported since the first release that included published bundles.- Returns:
- the minimum version of Strange Eons needed to unpack a bundle published with this compression method, or 0
- See Also:
StrangeEons.getBuildNumber()
-
forExtension
public static PluginBundlePublisher.CompressionMethod forExtension(java.lang.String name)
Returns the compression method associated with the extension part of a file name in a string. For example, given "OmicronPlugin.seplugin.pbz", returnsBZIP2
. If no extension is recognized, returnsnull
.- Parameters:
name
- the file name to examine- Returns:
- the correct compression method for the extension, or
null
-
getDefault
public static PluginBundlePublisher.CompressionMethod getDefault()
Returns the default compression method for plug-in bundles. The default method can change from version to version as better compression methods become available.- Returns:
- the default compression method for this release
-
-