Package acme.dataapp

Examples of acme.dataapp.AirportCodes


    try {
      String path = request.getPathInfo().toLowerCase();

      if (path.contains("/api/airportcodes")) {
        // Outputs the airport codes
        AirportCodes ac = AirportCodes.getInstance();
        res = ac.getCodes();

      } else if (path.contains("/api/airportcodebycity/")) {
        // Gets Airport by City
        int x = path.lastIndexOf("bycity/") + 7;
        String p = path.substring(x);
        log.info("Get Airport Code by City : " + p);
        AirportCodes ac = AirportCodes.getInstance();
        String code = ac.getCodeByCity(p);
        res.put("code", code);

      } else if (path.contains("/api/airportcodebycityandsate/")) {
        // Gets Airport Code by City and State
        int x = path.lastIndexOf("/api/airportcodebycityandsate/")
            + "/api/airportcodebycityandsate/".length();
        String p = path.substring(x);
        String[] par = p.split("/");
        log.info("Get Airport Code by City and State : " + par[0] + " "
            + par[1]);
        AirportCodes ac = AirportCodes.getInstance();
        String code = ac.getCode(par[0], par[1]);
        res.put("code", code);

      } else if (path.contains("/api/flights/all")) {
        // Gets the details of all flights
        Flights fs = Flights.getInstance();
View Full Code Here

TOP

Related Classes of acme.dataapp.AirportCodes

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.