public final class ArchiverFactory
extends java.lang.Object
Archiver
instances by a given archiver type name. Use the constants in this class to
pass to the factory method.Modifier and Type | Method and Description |
---|---|
static Archiver |
createArchiver(ArchiveFormat archiveFormat)
Creates an Archiver for the given archive format.
|
static Archiver |
createArchiver(ArchiveFormat archiveFormat,
CompressionType compression)
Creates an Archiver for the given archive format that uses compression.
|
static Archiver |
createArchiver(java.io.File archive)
Probes the given
File for its file type and creates an Archiver based on this file type. |
static Archiver |
createArchiver(FileType fileType)
Creates an Archiver that handles the given
FileType . |
static Archiver |
createArchiver(java.lang.String archiveFormat)
Creates an Archiver for the given archive format.
|
static Archiver |
createArchiver(java.lang.String archiveFormat,
java.lang.String compression)
Creates an Archiver for the given archive format that uses compression.
|
public static Archiver createArchiver(java.io.File archive) throws java.lang.IllegalArgumentException
File
for its file type and creates an Archiver
based on this file type. If the
File has a composite file extension such as ".tar.gz", the created Archiver
will also handle ".gz"
compression.archive
- the archive file to check.java.lang.IllegalArgumentException
- if the given file is not a known archivepublic static Archiver createArchiver(FileType fileType)
FileType
. The Archiver may handle compression inherently, if
the FileType
uses a compression type, such as ".tgz" might.fileType
- the file typepublic static Archiver createArchiver(java.lang.String archiveFormat, java.lang.String compression) throws java.lang.IllegalArgumentException
archiveFormat
- the archive format e.g. "tar" or "zip"compression
- the compression algorithm name e.g. "gz"java.lang.IllegalArgumentException
- if the archive format or the compression type is unknownpublic static Archiver createArchiver(ArchiveFormat archiveFormat, CompressionType compression)
archiveFormat
- the archive formatcompression
- the compression algorithmpublic static Archiver createArchiver(java.lang.String archiveFormat) throws java.lang.IllegalArgumentException
archiveFormat
- the archive format e.g. "tar" or "zip"java.lang.IllegalArgumentException
- if the archive format is unknownpublic static Archiver createArchiver(ArchiveFormat archiveFormat)
archiveFormat
- the archive format