Compress
Compress the source file or folder to the destination file or folder using the specified format:
zip
gzip (It will all files separately to the destination folder)
The {@code includeBaseFolder} argument is used to include the base folder as the root of the compressed file. The default is {@code true} .
The {@code overwrite} argument is used to overwrite the destination file if it already exists, else it will throw an exception. The default is {@code false} .
Method Signature
Arguments
Argument | Type | Required | Description | Default |
---|---|---|---|---|
|
|
| The format to use for the compression: zip or gzip. | |
|
|
| The absolute path to the source file or folder to compress. | |
|
|
| The absolute path with a file name to save as the compressed file. Extension is optional. | |
|
|
| Whether to include the base folder as the root of the compressed file. Default is true. |
|
|
|
| Whether to overwrite the destination file if it already exists. Default is false. |
|
|
|
| The prefix directory to store the compressed files under. Default is empty. | |
|
|
| A regular expression to filter the files to compress or a function that receives the file name and returns a boolean. | |
|
|
| Whether to compress the files recursively. Default is true. |
|
Examples
Related
Last updated