Class Archives

    • Constructor Detail

      • Archives

        public Archives()
    • Method Detail

      • uncompress

        public static Path uncompress​(Path archiveFile,
                                      Path targetDir)
                               throws IOException
        Unzips the zip file to the target directory.

        Note this is specific to how WildFly is archived. The first directory is assumed to be the base home directory and will returned.

        Parameters:
        archiveFile - the archive to uncompress, can be a .zip or .tar.gz
        targetDir - the directory to extract the zip file to
        Returns:
        the path to the extracted directory
        Throws:
        IOException - if an I/O error occurs
      • uncompress

        public static Path uncompress​(Path archiveFile,
                                      Path targetDir,
                                      boolean replaceIfExists)
                               throws IOException
        Unzips the zip file to the target directory.

        Note this is specific to how WildFly is archived. The first directory is assumed to be the base home directory and will returned.

        Parameters:
        archiveFile - the archive to uncompress, can be a .zip or .tar.gz
        targetDir - the directory to extract the zip file to
        replaceIfExists - if true replace the existing files if they exist
        Returns:
        the path to the extracted directory
        Throws:
        IOException - if an I/O error occurs