public interface Compressor
Modifier and Type | Method and Description |
---|---|
void |
compress(java.io.File source,
java.io.File destination)
Compresses the given input file to the given destination directory or file.
|
void |
decompress(java.io.File source,
java.io.File destination)
Decompresses the given source file to the given destination directory or file.
|
java.lang.String |
getFilenameExtension()
Returns the filename extension that indicates the file format this compressor handles.
|
void compress(java.io.File source, java.io.File destination) throws java.lang.IllegalArgumentException, java.io.IOException
Requires the source the be an existing and readable File, and the destination to be either a file or a directory. If you pass a directory, the name of the source file is used, with the appended filename extension suffix of the compression type.
source
- the source file to compressdestination
- the destination filejava.lang.IllegalArgumentException
- if the source is not readable or the destination is not writablejava.io.IOException
- when an I/O error occursvoid decompress(java.io.File source, java.io.File destination) throws java.lang.IllegalArgumentException, java.io.IOException
Requires the source the be an existing and readable File, and the destination to be either a file or a directory. If you pass a directory, the name of the source file is used, with the removed filename extension suffix of the compression type.
source
- the compressed source file to decompressdestination
- the destination filejava.lang.IllegalArgumentException
- if the source is not readable or the destination is not writablejava.io.IOException
- when an I/O error occursjava.lang.String getFilenameExtension()