org.eclipse.rdf4j.common.io

## Class ZipUtil

- java.lang.Object
- - org.eclipse.rdf4j.common.io.ZipUtil

-     public class ZipUtil
      extends Object

  Zip-related utilities.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ZipUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `extract(File zipFile, File destDir)` Extract the contents of a zipfile to a directory.
    `static void` | `extract(ZipFile zipFile, File destDir)` Extract the contents of a zipfile to a directory.
    `static boolean` | `isZipStream(InputStream in)` Test if an input stream is a zip input stream by checking the "magic number"
    `static void` | `writeEntry(ZipFile zipFile, ZipEntry entry, File destDir)` Write an entry to a zip file.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ZipUtil

          public ZipUtil()

  - ### Method Detail

    - #### isZipStream

          public static boolean isZipStream(InputStream in)
                                     throws IOException

      Test if an input stream is a zip input stream by checking the "magic number"
      Parameters:
        `in` - input stream
      Returns:
        true if start of input stream matches magic number
      Throws:
        `IOException`

    - #### extract

          public static void extract(File zipFile,
                                     File destDir)
                              throws IOException

      Extract the contents of a zipfile to a directory.
      Parameters:
        `zipFile` - the zip file to extract
        `destDir` - the destination directory
      Throws:
        `IOException` - when something untoward happens during the extraction process

    - #### extract

          public static void extract(ZipFile zipFile,
                                     File destDir)
                              throws IOException

      Extract the contents of a zipfile to a directory.
      Parameters:
        `zipFile` - the zip file to extract
        `destDir` - the destination directory
      Throws:
        `IOException` - when something untoward happens during the extraction process

    - #### writeEntry

          public static void writeEntry(ZipFile zipFile,
                                        ZipEntry entry,
                                        File destDir)
                                 throws IOException

      Write an entry to a zip file.
      Parameters:
        `zipFile` - the zip file to read from
        `entry` - the entry to process
        `destDir` - the file to write to
      Throws:
        `IOException` - if the entry could not be processed

Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.