Class CompressionUtils

java.lang.Object
org.sonarsource.scanner.lib.internal.util.CompressionUtils

public final class CompressionUtils extends Object
  • Method Details

    • unzip

      public static Path unzip(Path zip, Path toDir) throws IOException
      Unzip a file into a directory. The directory is created if it does not exist.
      Returns:
      the target directory
      Throws:
      IOException
    • unzip

      public static Path unzip(Path zip, Path toDir, Predicate<ZipEntry> filter) throws IOException
      Unzip a file to a directory.
      Parameters:
      zip - the zip file. It must exist.
      toDir - the target directory. It is created if needed.
      filter - filter zip entries so that only a subset of directories/files can be extracted to target directory.
      Returns:
      the parameter toDir
      Throws:
      IOException
    • extractTarGz

      public static void extractTarGz(Path compressedFile, Path targetDir) throws IOException
      Throws:
      IOException