public final class CompressorFactory
extends java.lang.Object
Compressor
instances by a given compression algorithm. Use the constants in this class
to pass to the factory method.Modifier and Type | Method and Description |
---|---|
static Compressor |
createCompressor(CompressionType compression)
Creates a compressor from the given CompressionType.
|
static Compressor |
createCompressor(java.io.File file)
Probes the given
File for its file type and creates a Compressor based on this file type. |
static Compressor |
createCompressor(FileType fileType)
Creates a new
Compressor for the given FileType . |
static Compressor |
createCompressor(java.lang.String compression)
Creates a compressor from the given compression type.
|
public static Compressor createCompressor(java.io.File file) throws java.lang.IllegalArgumentException
File
for its file type and creates a Compressor
based on this file type.file
- the file to check.java.lang.IllegalArgumentException
- if the given file is not a known compressed file typepublic static Compressor createCompressor(FileType fileType) throws java.lang.IllegalArgumentException
Compressor
for the given FileType
.fileType
- the file type to create the compressor forjava.lang.IllegalArgumentException
- if the given file type is not a known compression typepublic static Compressor createCompressor(java.lang.String compression) throws java.lang.IllegalArgumentException
compression
- the name of the compression algorithm e.g. "gz" or "bzip2".Compressor
instance for the given compression algorithmjava.lang.IllegalArgumentException
- if the compression type is unknownpublic static Compressor createCompressor(CompressionType compression)
compression
- the type of the compression algorithmCompressor
instance that uses the specified compression algorithm.