Class ZipUtils

java.lang.Object
org.openl.util.ZipUtils

public final class ZipUtils extends Object
A utility class to work with zip files. File names in a zip are in UTF-8.
Author:
Yury Molchan
  • Method Details

    • extractAll

      public static void extractAll(File zipFile, File outputFolder) throws IOException
      Extract all files from a zip file into a directory.
      Parameters:
      zipFile - the input zip file
      outputFolder - the output folder for extracted files
      Throws:
      IOException
    • extractAll

      public static void extractAll(InputStream zippedStream, File outputFolder) throws IOException
      Extract all files from a zipped stream into a directory.
      Parameters:
      zippedStream - the zipped input stream
      outputFolder - the output folder for extracted files
      Throws:
      IOException
    • archive

      public static void archive(File sourceDirectory, File targetFile) throws IOException
      Pack all files in a directory to a zip file.
      Throws:
      IOException
    • contains

      public static boolean contains(File zipFile, Predicate<String> names)
    • toJarURI

      public static URI toJarURI(Path pathToZip)