--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableServlet.java 2010/05/02 15:57:49 696 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableServlet.java 2010/05/03 07:42:02 697 @@ -41,15 +41,22 @@ } String train = request.getParameter("train").trim(); + String trainID; + String type = request.getParameter("type"); - String sections[] = train.split(" "); - if (sections.length != 2) { - response.sendError(400, "Invalid parameter"); - return; + if (type != null) { + trainID = train; + } else { //remove this failover sometime after release of client 0.6.4 + String sections[] = train.split(" "); + if (sections.length != 2) { + response.sendError(400, "Invalid parameter"); + return; + } + + type = lookupType(sections[0]); + trainID = sections[1]; } - - String type = lookupType(sections[0]); - String trainID = sections[1]; + try { List timetable = fetcher.cachedLookupTimetable(trainID, type); @@ -70,7 +77,7 @@ } } - + /*remove /outcomment/deprecate after 0.6.4 release */ String lookupType(String trainCode) { trainCode = trainCode.toLowerCase();