@Internal public class ArchiveUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
compressFiles(ArchiverType archiverType,
Iterable<File> sourceFiles,
File archiveFile,
File baseDirectory)
Compresses multiple files into a single archive.
|
static void |
extractArchive(ArchiverType archiverType,
File archiveFile,
File destinationDirectory)
Extracts an archive contents into the provided destination directory.
|
public static void compressFiles(@NotNull ArchiverType archiverType, @NotNull Iterable<File> sourceFiles, @NotNull File archiveFile, @Nullable File baseDirectory) throws IOException
archiverType
- Type of archiver that will be used to package the files.sourceFiles
- Files to archive. Each file must exist.archiveFile
- Archive file to create. Must not exist.baseDirectory
- Optional argument: base directory of all the files to compress. If given, all file paths in
the resulting archive will be calculated relatively to this directory. Must exist. If
skipped, all source files will be placed in the archive root.IOException
- if any IO operation fails (e.g. insufficient permissions to create new file)IllegalArgumentException
- if passed arguments do not meet requirementspublic static void extractArchive(@NotNull ArchiverType archiverType, @NotNull File archiveFile, @NotNull File destinationDirectory) throws IOException
archiverType
- Type of archiver that will be used to extract archive files.archiveFile
- Archive file. Must exists.destinationDirectory
- Directory to which the content of the archive should be copied. Must exist.IOException
- if any IO operation fails (e.g. insufficient permissions to create new file)IllegalArgumentException
- if passed arguments do not meet requirementsCopyright © 2018 Atlassian Software Systems Pty Ltd. All rights reserved.