private void validateCommonServicesDirectory(File commonServicesRoot) throws AmbariException {
    if(commonServicesRoot != null) {
      LOG.info("Validating common services directory {} ...",
          commonServicesRoot);

      String commonServicesRootAbsolutePath = commonServicesRoot.getAbsolutePath();
      if (LOG.isDebugEnabled()) {
        LOG.debug("Loading common services information, commonServicesRoot = {}", commonServicesRootAbsolutePath);
      }

      if (!commonServicesRoot.isDirectory() && !commonServicesRoot.exists()) {
        throw new AmbariException("" + Configuration.COMMON_SERVICES_DIR_PATH
            + " should be a directory with common services"
            + ", commonServicesRoot = " + commonServicesRootAbsolutePath);
      }
    }
  }
Validate that the specified common services root is a valid directory.

@param commonServicesRoot the common services root directory to validate
@throws AmbariException if the specified common services root directory is invalid
ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java