Package jetbrains.buildServer.zip
Class ZipExtractor
- java.lang.Object
-
- jetbrains.buildServer.zip.ZipExtractor
-
public class ZipExtractor extends Object
-
-
Constructor Summary
Constructors Constructor Description ZipExtractor(ZipReader zipReader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidextractDirectory(String zipPath, File targetDirectory)Extract directory content from the ZIP archive.voidextractFile(String zipPath, File targetFile)Extract file from the ZIP archivevoidextractFile(String zipPath, File targetFile, TCStreamUtil.ProgressIncrementListener progressListener)
-
-
-
Constructor Detail
-
ZipExtractor
public ZipExtractor(ZipReader zipReader)
-
-
Method Detail
-
extractDirectory
public void extractDirectory(@NotNull String zipPath, @NotNull File targetDirectory) throws IOExceptionExtract directory content from the ZIP archive. For example, if the archive containsa/b/c/1.txt a/b/c/2.txt 3.txt
andzipPath = "a/b/c" targetDirectory = "/tmp"then"/tmp/1.txt"and"/tmp/2.txt"will be created. IfzipPathis empty then all files will be extracted. Files intargetDirectorywith the name equal to the extracted file name will be overwritten, with the different name will not be modified. AlsotargetDirectorywill be created if not exist.- Throws:
IOException
-
extractFile
public void extractFile(@NotNull String zipPath, @NotNull File targetFile) throws IOExceptionExtract file from the ZIP archive For example, ifzipPath = "a/b/c.txt"thentargetFile with content of the "a/b/c.txt" will be created.IftargetFiledoesn't exist, it will be created. Otherwise it will be overwritten.- Throws:
FileNotFoundException- if no entry with namedzipPathhas been found in the archive.IOException- if any other I/O error occurs.- See Also:
extractFile(String, File, TCStreamUtil.ProgressIncrementListener)
-
extractFile
public void extractFile(@NotNull String zipPath, @NotNull File targetFile, @Nullable TCStreamUtil.ProgressIncrementListener progressListener) throws IOException- Throws:
FileNotFoundException- if no entry with namedzipPathhas been found in the archive.IOException- if any other I/O error occurs.- See Also:
extractFile(String, File)
-
-