public class Unzip extends Unarchiver
Constructor and Description |
---|
Unzip() |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableSet<Path> |
extractArchive(Path archiveFile,
ProjectFilesystem filesystem,
Path relativePath,
Optional<Path> stripPrefix,
PatternsMatcher entriesToExclude,
ExistingFileMode existingFileMode)
Unzips a file to a destination and returns the paths of the written files.
|
static com.google.common.collect.ImmutableSet<Path> |
getZipMembers(Path archiveAbsolutePath)
Gets a set of files that are contained in an archive
|
extractArchive, extractArchive, extractArchive, extractArchive
public com.google.common.collect.ImmutableSet<Path> extractArchive(Path archiveFile, ProjectFilesystem filesystem, Path relativePath, Optional<Path> stripPrefix, PatternsMatcher entriesToExclude, ExistingFileMode existingFileMode) throws IOException
extractArchive
in class Unarchiver
archiveFile
- The path to the archivefilesystem
- The filesystem that will be extracted intorelativePath
- The path relative to the filesystem to extract files intostripPrefix
- If provided, only files under this prefix will be extracted. This prefix
prefix will also be removed from the destination path. e.g. foo.tar.gz/foo/bar/baz with a
prefix of foo will extract bar/baz into the destination directory. If not provided, no
stripping is done.entriesToExclude
- Entries that match this matcher will not be extractedexistingFileMode
- How to handle existing filesIOException
- If the archive could not be extracted for any reasonpublic static com.google.common.collect.ImmutableSet<Path> getZipMembers(Path archiveAbsolutePath) throws IOException
archiveAbsolutePath
- The absolute path to the archiveIOException
- If there is an error reading the archive