Class AbstractUnzipper

    • Field Detail

      • destDir

        protected File destDir
    • Constructor Detail

      • AbstractUnzipper

        public AbstractUnzipper()
    • Method Detail

      • saveEntry

        protected File saveEntry​(InputStream is,
                                 ZipEntry entry)
                          throws IOException
        save the contents of the given inputstream into a file given by the zip entry. If the zip entry is a directory, it is returned without writing the input stream into it.
        Parameters:
        is - inputstream to read from
        entry - an entry in the zip file to save the inputstream to
        Returns:
        the file that represents the zip entry. It may be a directory.
        Throws:
        IOException - if there are problems writing the file
        IllegalArgumentException - if the zip entry attempts to perform a directory traversal with relative paths ('../') and traverses outside the {@link this#destDir}.