protected void validateConfig(InputStream  configStream) throws SAXException, IOException {
    SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);

    URL schemaUrl = getClass().getClassLoader().getResource(VIEW_XSD);
    Schema schema = schemaFactory.newSchema(schemaUrl);

    schema.newValidator().validate(new StreamSource(configStream));
  }
Validate the given view descriptor file against the view schema.

@param configStream  input stream of view descriptor file to be validated

@throws SAXException if the validation fails
@throws IOException if the descriptor file can not be read
ambari-server/src/main/java/org/apache/ambari/server/view/ViewArchiveUtility.java