private void extractMpackTar(Mpack mpack, Path mpackTarPath, String mpackDirectory) throws IOException {

    extractTar(mpackTarPath, mpackStaging);

    String mpackTarDirectory = mpackTarPath.toString();
    Path extractedMpackDirectory = Files.move
      (Paths.get(mpackStaging + File.separator + mpackTarDirectory
          .substring(mpackTarDirectory.lastIndexOf('/') + 1, mpackTarDirectory.indexOf(".tar")) + File.separator),
        Paths.get(mpackDirectory), StandardCopyOption.REPLACE_EXISTING);

    LOG.debug("Extracting Mpack definitions into :" + extractedMpackDirectory);

    createServicesDirectory(extractedMpackDirectory, mpack);

    File metainfoFile = new File(extractedMpackDirectory + File.separator + "metainfo.xml");
    // if metainfo.xml doesn't exist in mpack generate it
    if (!metainfoFile.exists()) {
      generateMetainfo(metainfoFile, mpack);
    }

    createSymLinks(mpack);
  }
Mpack is downloaded as a tar.gz file.
It is extracted into /var/lib/ambari-server/resources/mpack-v2/{mpack-name}/{mpack-version} directory

@param mpack          Mpack to process
@param mpackTarPath   Path to mpack tarball
@param mpackDirectory Mpack directory
@throws IOException
ambari-server/src/main/java/org/apache/ambari/server/mpack/MpackManager.java