Examples of YamlReader


Examples of net.sourceforge.yamlbeans.YamlReader

   *
   * @param response String returned from the /api/appversion/create call.
   * @return YAML parsed into Map.
   */
  private ArrayList<String> validateBeginYaml(String response) {
    YamlReader yaml = new YamlReader(new StringReader(response));
    try {
      Object obj = yaml.read();
      if (obj != null) {
        @SuppressWarnings("unchecked")
        Map<String, Object> responseMap = (Map<String, Object>) obj;
        if (responseMap != null) {
          obj = responseMap.get("warnings");
View Full Code Here

Examples of net.sourceforge.yamlbeans.YamlReader

    if (isServingResp.isEmpty()) {
      return result.build();
    }

    try {
      YamlReader yamlReader = new YamlReader(isServingResp);
      @SuppressWarnings("unchecked")
      Map<Object, Object> resultMap = yamlReader.read(Map.class, String.class);
      for (Object key : resultMap.keySet()) {
        result.put((String) key, (String) resultMap.get(key));
      }
    } catch (YamlException e) {
      logger.severe("Unable to parse Yaml from response: " + result);
View Full Code Here

Examples of net.sourceforge.yamlbeans.YamlReader

  @VisibleForTesting
  Map<String, String> parseIsConfigUpdatedResponse(String isConfigUpdatedResp) {
    ImmutableMap.Builder<String, String> result = ImmutableMap.builder();
    try {
      YamlReader yamlReader = new YamlReader(isConfigUpdatedResp);
      @SuppressWarnings("unchecked")
      Map<Object, Object> resultMap = yamlReader.read(Map.class, String.class);
      if (resultMap == null) {
        return result.build();
      }

      for (Object key : resultMap.keySet()) {
View Full Code Here

Examples of net.sourceforge.yamlbeans.YamlReader

  @VisibleForTesting
  static String getRuntime(String appYaml) {
    String result = "?";
    try {
      Map<?, ?> yaml = (Map<?, ?>) new YamlReader(appYaml).read();
      Object runtime = yaml.get("runtime");
      if (runtime instanceof String) {
        result = (String) runtime;
      }
    } catch (YamlException ex) {
View Full Code Here

Examples of net.sourceforge.yamlbeans.YamlReader

    List<Pattern> skipFiles = new ArrayList<>();
    if (appYaml == null) {
      return skipFiles;
    }
    try {
      Map<?, ?> yaml = (Map<?, ?>) new YamlReader(appYaml).read();
      List<?> skipFileList = (List<?>) yaml.get("skip_files");
      if (skipFileList != null) {
        for (Object skipFile : skipFileList) {
          skipFiles.add(Pattern.compile(skipFile.toString()));
        }
View Full Code Here

Examples of net.sourceforge.yamlbeans.YamlReader

    }
    return null;
  }

  public static DosXml parse(Reader yaml) {
    YamlReader reader = new YamlReader(yaml);
    reader.getConfig().setPropertyElementType(DosYaml.class,
                                              "blacklist",
                                              DosXml.BlacklistEntry.class);
    try {
      DosYaml dosYaml = reader.read(DosYaml.class);
      if (dosYaml == null) {
        throw new AppEngineConfigException("Empty dos configuration.");
      }
      return dosYaml.toXml();
    } catch (YamlException ex) {
View Full Code Here

Examples of net.sourceforge.yamlbeans.YamlReader

   */
  @SuppressWarnings("unchecked")
  public static Map<String, Object> genericParse(String data)
      throws AppEngineConfigException {
    try {
      YamlReader reader = new YamlReader(data);
      return reader.read(Map.class);
    } catch (YamlException exc) {
      throw new AppEngineConfigException("Invalid YAML data: " + data, exc);
    }
  }
View Full Code Here

Examples of net.sourceforge.yamlbeans.YamlReader

   * @return A {@link List} of {@link IndexesXml} instances representing one or
   *         more parsed Yaml documents.
   * @throws YamlException If the Yaml parser has trobule parsing.
   */
  private static List<IndexesXml> parseMultiple(Reader yaml, IndexesXml xml) throws YamlException {
    YamlReader reader = new YamlReader(yaml);
    reader.getConfig().setPropertyElementType(IndexYaml.class, "indexes", IndexYaml.Index.class);
    reader.getConfig().setPropertyElementType(
        IndexYaml.Index.class, "properties", IndexYaml.Property.class);
    List<IndexesXml> list = new LinkedList<IndexesXml>();
    while (true) {
      IndexYaml indexYaml = reader.read(IndexYaml.class);
      if (null == indexYaml) {
        break;
      } else {
        list.add(indexYaml.toXml(xml));
      }
View Full Code Here

Examples of net.sourceforge.yamlbeans.YamlReader

    return null;
  }

  @VisibleForTesting
  static DispatchXml parseImpl(Reader yaml) {
    YamlReader reader = new YamlReader(yaml);
    reader.getConfig().setPropertyElementType(DispatchYaml.class, "dispatch",
        DispatchYamlEntry.class);
    try {
      DispatchYaml dispatchYaml = reader.read(DispatchYaml.class);
      if (dispatchYaml == null) {
        throw new AppEngineConfigException("Empty dispatch.yaml configuration.");
      }
      return dispatchYaml.toXml();
    } catch (YamlException ex) {
View Full Code Here

Examples of net.sourceforge.yamlbeans.YamlReader

    }

    @Override
    public void execute() {
      String response = admin.listVersions();
      YamlReader yaml = new YamlReader(new StringReader(response));
      try {
        Object obj = yaml.read();
        if (obj != null) {
          @SuppressWarnings("unchecked")
          Map<String, ArrayList<String>> responseMap = (Map<String, ArrayList<String>>) obj;
          if (!responseMap.isEmpty()) {
            System.out.println(response);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.