private Mpack downloadMpackMetadata(String mpackURI) throws IOException  {
    URL url = new URL(mpackURI);
    File stagingDir = new File(mpackStaging.toString() + File.separator + MPACK_TAR_LOCATION);
    Path targetPath = new File(stagingDir.getPath() + File.separator + MPACK_METADATA).toPath();

    LOG.debug("Download mpack.json and store in :" + targetPath);

    if (!stagingDir.exists()) {
      stagingDir.mkdir();
    }

    Files.copy(url.openStream(), targetPath, StandardCopyOption.REPLACE_EXISTING);
    //Read the mpack.json file into Mpack Object for further use.
    Gson gson = new Gson();
    Mpack mpack = gson.fromJson(new FileReader(targetPath.toString()), Mpack.class);
    return mpack;
  }
Download the mpack.json as a primary step towards providing
meta information about mpack and associated services
@param mpackURI
@return
@throws IOException
ambari-server/src/test/java/org/apache/ambari/server/mpack/MpackManagerMock.java