Class ArchiveExtractor

java.lang.Object
com.dua3.gradle.jdkprovider.provision.ArchiveExtractor

public final class ArchiveExtractor extends Object
Extracts archives supported for typical JDK packages: .zip and .tar.gz
  • Method Details

    • extract

      public static void extract(Path archive, Path targetDir) throws IOException
      Extracts the specified archive file into the target directory. Supports ZIP and TAR.GZ (or TGZ) formats. The method will create the target directory if it does not already exist.
      Parameters:
      archive - the path to the archive file to be extracted; must not be null
      targetDir - the target directory where the contents of the archive will be extracted; must not be null
      Throws:
      IOException - if an I/O error occurs, if the archive format is not supported, or if an extraction entry attempts to escape the target directory