@Internal
public interface Archiver
An archiver is an object capable of creating archive files and extracting their content. Each archiver should be capable of handling at least one type of archive, e.g. zip or gz.
Modifier and Type | Method and Description |
---|---|
void |
compressFiles(Iterable<File> sourceFiles,
File archiveFile,
File baseDirectory)
Compresses multiple files into a single archive.
|
void |
extractArchive(File archiveFile,
File destinationDirectory)
Extracts an archive contents into the provided destination directory.
|
List<String> |
getArchiveFileExtensions()
Return a list of legal archive file extensions for archive type handled by this archiver.
|
void compressFiles(@NotNull Iterable<File> sourceFiles, @NotNull File archiveFile, @Nullable File baseDirectory) throws IOException
sourceFiles
- Files to archive. Each file will exist. If baseDirectory argument is given, all files
will be contained within that directory.archiveFile
- Archive file to create. Will not exist.baseDirectory
- Optional argument: base directory of all the files to compress. If given, all file paths in
the resulting archive should be calculated relatively to this directory. If skipped, all
source files should be placed in the archive root. If the argument is present, the file will
exist and will be a directory.IOException
- if any IO operation failsvoid extractArchive(@NotNull File archiveFile, @NotNull File destinationDirectory) throws IOException
archiveFile
- Archive file. Will exists.destinationDirectory
- Directory to which the content of the archive should be copied. This file will exist
and will be a directory.IOException
- if any IO operation fails@NotNull List<String> getArchiveFileExtensions()
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.