private XmlHolder loadXml(String definitionUrl) throws AmbariException {
    XmlHolder holder = new XmlHolder();
    holder.url = definitionUrl;

    int connectTimeout = s_configuration.getVersionDefinitionConnectTimeout();
    int readTimeout = s_configuration.getVersionDefinitionReadTimeout();

    try {
      URI uri = new URI(definitionUrl);

      if (uri.getScheme().equalsIgnoreCase("file")) {
        if (!s_configuration.areFileVDFAllowed()) {
          throw new AmbariException("File URL for VDF are not enabled");
        }
        InputStream stream = uri.toURL().openStream();
        holder.xmlString = IOUtils.toString(stream, "UTF-8");
      } else {
        URLRedirectProvider provider = new URLRedirectProvider(connectTimeout, readTimeout, true);
        URLRedirectProvider.RequestResult requestResult = provider.executeGet(definitionUrl);

        if (requestResult.getCode() != HttpStatus.SC_OK) {
          String err = String.format("Could not load url from '%s' with code '%d'.  %s",
                                     definitionUrl, requestResult.getCode(), requestResult.getContent());
          throw new AmbariException(err);
        }

        holder.xmlString = requestResult.getContent();
      }
      holder.xml = VersionDefinitionXml.load(holder.xmlString);
    } catch (Exception e) {
      String err = String.format("Could not load url from %s.  %s",
          definitionUrl, e.getMessage());
      throw new AmbariException(err, e);
    }

    return holder;
  }
Load the xml data from a url
@param definitionUrl
@return the XmlHolder instance
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java