private Boolean createMpackDirectory(Mpack mpack)
    throws IOException, ResourceAlreadyExistsException {
        //Check if the mpack already exists
        List<MpackEntity> mpackEntities = mpackDAO.findByNameVersion(mpack.getName(), mpack.getVersion());
        if (mpackEntities.size() == 0) {
          File mpackDirectory = new File(mpackStaging + File.separator + mpack.getName());

          if (!mpackDirectory.exists()) {
            mpackDirectory.mkdirs();
          }
          return true;
        } else {
          String message =
            "Mpack: " + mpack.getName() + " version: " + mpack.getVersion() + " already exists in server";
          throw new ResourceAlreadyExistsException(message);
        }
  }
Create the new mpack directory to hold the mpack files.

@param mpack        Mpack to process
@return boolean
@throws IOException
ambari-server/src/main/java/org/apache/ambari/server/mpack/MpackManager.java