public static Validator getPropertySchemaValidator() throws AmbariException {
    SchemaFactory factory =
      SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema;
    ClassLoader classLoader = StackManager.class.getClassLoader();
    try {
      schema = factory.newSchema(classLoader.getResource(PROPERTY_SCHEMA_PATH));
    } catch (SAXException e) {
      throw new AmbariException(String.format("Failed to parse property schema file %s", PROPERTY_SCHEMA_PATH), e);
    }
    return schema.newValidator();
  }
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