How to untar th .tgz format file in scala

How to untar the file which was in .tgz file.

the below code is for unzip the file.

From the below code how to write the untar the file.

import java.io.{File, FileInputStream, FileOutputStream}
import java.nio.file.{Files, Path, Paths}
import java.util.zip.ZipFile

import sun.security.util.IOUtils

import scala.collection.JavaConverters._
class Venkat {
def unzip1(zipPath: Path, outputPath: Path): Unit = {
val zipFile = new ZipFile(zipPath.toFile)
for (entry <- zipFile.entries.asScala) {
val path = outputPath.resolve(entry.getName)
if (entry.isDirectory) {
Files.createDirectories(path)
} else {
Files.createDirectories(path.getParent)
Files.copy(zipFile.getInputStream(entry), path)
}
}
}

}
object Sam {
def main(args: Array[String]): Unit = {
val obja = new Venkat()
// obja.unzip1("/home/chthp00042/Downloads/Compress/USAGE_052801_G-ZZZC.tgz", “/home/chthp00042/Downloads/Compress” : String)
obja.unzip1(Paths.get("/home/chthp00042/Downloads/Compress/USAGE_052801_G-ZZZC.zip"),Paths.get("/home/chthp00042/Downloads/Compress"))
}
}