code: public static void tarGzExtractSingleFile(File tarGz, File destination, String pathInTarGz) throws IOException {
          try(TarArchiveInputStream tin = new TarArchiveInputStream(new GZIPInputStream(new BufferedInputStream(new FileInputStream(tarGz))))) {
              ArchiveEntry entry;
              List<String> out = new ArrayList<>();
              boolean extracted = false;
              while((entry = tin.getNextTarEntry()) != null){
                  String name = entry.getName();
                  if(pathInTarGz.equals(name)){
                      try(OutputStream os = new BufferedOutputStream(new FileOutputStream(destination))){
                          IOUtils.copy(tin, os);
                      }
                      extracted = true;
                  }
              }
              Preconditions.checkState(extracted, "No file was extracted. File not found? %s", pathInTarGz);
          }
      }
docs: Extract a single file from a tar.gz file. Does not support directories.
  NOTE: This should not be used for batch extraction of files, due to the need to iterate over the entries until the
  specified entry is found. Use {@link #unzipFileTo(String, String)} for batch extraction instead
  
  @param tarGz       A tar.gz file
  @param destination The destination file to extract to
  @param pathInTarGz The path in the tar.gz file to extract