public ViewConfig getViewConfigFromArchive(File archiveFile)
      throws JAXBException, IOException {
    ClassLoader cl = URLClassLoader.newInstance(new URL[]{archiveFile.toURI().toURL()}, null);

    InputStream configStream = cl.getResourceAsStream(VIEW_XML);
    if (configStream == null) {
      configStream = cl.getResourceAsStream(WEB_INF_VIEW_XML);
      if (configStream == null) {
        throw new IllegalStateException(
            String.format("Archive %s doesn't contain a view descriptor.", archiveFile.getAbsolutePath()));
      }
    }

    try {

      JAXBContext jaxbContext       = JAXBContext.newInstance(ViewConfig.class);
      Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();

      return (ViewConfig) jaxbUnmarshaller.unmarshal(configStream);
    } finally {
      configStream.close();
    }
  }
Get the view configuration from the given archive file.

@param archiveFile  the archive file

@return the associated view configuration

@throws JAXBException if xml is malformed
ambari-server/src/main/java/org/apache/ambari/server/view/ViewArchiveUtility.java