Class ZipHelper

java.lang.Object
io.github.erdos.stencil.impl.ZipHelper

public final class ZipHelper extends Object
Various helpers for handling ZIP files.
  • Method Details

    • unzipStreamIntoDirectory

      public static void unzipStreamIntoDirectory(InputStream zipFileStream, File unzipTargetDirectory) throws 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 file
      unzipTargetDirectory - a directory where zip contents are put
      Throws:
      IllegalArgumentException - when any param is null.
      IllegalStateException - when target file already exists.
      IOException - on file system error