public static void validateAllPropertyXmlsInFolderRecursively(File stackRoot, Validator validator) throws AmbariException {
    Collection<File> files = FileUtils.listFiles(stackRoot, new String[]{"xml"}, true);
    for (File file : files) {
      try {
        if (file.getParentFile().getName().contains("configuration")) {
          validator.validate(new StreamSource(file));
        }
      } catch (Exception e) {
        String msg = String.format("File %s didn't pass the validation. Error message is : %s", file.getAbsolutePath(), e.getMessage());
        LOG.error(msg);
        throw new AmbariException(msg);
      }
    }
  }
Validate that the specified stack root is a valid directory.

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