public final class CompressorFactory extends 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(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(String compression)
Creates a compressor from the given compression type.
|
public static Compressor createCompressor(File file) throws IllegalArgumentException
File for its file type and creates a Compressor based on this file type.file - the file to check.IllegalArgumentException - if the given file is not a known compressed file typepublic static Compressor createCompressor(FileType fileType) throws IllegalArgumentException
Compressor for the given FileType.fileType - the file type to create the compressor forIllegalArgumentException - if the given file type is not a known compression typepublic static Compressor createCompressor(String compression) throws IllegalArgumentException
compression - the name of the compression algorithm e.g. "gz" or "bzip2".Compressor instance for the given compression algorithmIllegalArgumentException - 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.Copyright © 2013-2014. All Rights Reserved.