Package fi.luomus.commons.tipuapi

Examples of fi.luomus.commons.tipuapi.TipuAPIClient


    s = stringCache.get("S"); // - " -
    s = stringCache.get("A"); // note: loader used
  }
 
  private static void tipuApiClient_and_TipuApiResource_and_DocumentNode_Example() {
    TipuAPIClient api = null;
    try {
      api = new TipuAPIClientImple("https://h92.it.helsinki.fi/tipu-api", "tipuapi", "Barca4Valencia5Madrid6");

      TipuApiResource r = api.get(TipuAPIClient.SPECIES);
      Node helmipollo = r.getById("AEGFUN");
      String nimi_suomi = helmipollo.getNode("name").getContents();
      assert(nimi_suomi.equals("Helmipöllö"));
      String nimi_latina = "";
      for (Node n : helmipollo.getChildNodes("name")) {
        if (n.getAttribute("lang").equals("LA")) {
          nimi_latina = n.getContents();
          break;
        }
      }
      assert(nimi_latina.equals("Aegolius funereus"));
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      if (api != null) api.close();
    }
  }
View Full Code Here

TOP

Related Classes of fi.luomus.commons.tipuapi.TipuAPIClient

Copyright © 2018 www.massapicom. 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.