Package io.github.erdos.stencil.impl
Class ZipHelper
- java.lang.Object
-
- io.github.erdos.stencil.impl.ZipHelper
-
public final class ZipHelper extends java.lang.Object
Various helpers for handling ZIP files.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
unzipStreamIntoDirectory(java.io.InputStream zipFileStream, java.io.File unzipTargetDirectory)
Unzips contents of a zip file under the target directory.
-
-
-
Method Detail
-
unzipStreamIntoDirectory
public static void unzipStreamIntoDirectory(java.io.InputStream zipFileStream, java.io.File unzipTargetDirectory) throws java.io.IOException
Unzips contents of a zip file under the target directory. Closes stream. The unzipped files keep their relative paths from the zip file. That is files from the root of the zip file will be put directly under target directory, etc.- Parameters:
zipFileStream
- input stream of a ZIP fileunzipTargetDirectory
- a directory where zip contents are put- Throws:
java.lang.IllegalArgumentException
- when any param is null.java.lang.IllegalStateException
- when target file already exists.java.io.IOException
- on file system error
-
-