41 |
} |
} |
42 |
|
|
43 |
String train = request.getParameter("train").trim(); |
String train = request.getParameter("train").trim(); |
44 |
|
String trainID; |
45 |
|
String type = request.getParameter("type"); |
46 |
|
|
47 |
String sections[] = train.split(" "); |
if (type != null) { |
48 |
if (sections.length != 2) { |
trainID = train; |
49 |
response.sendError(400, "Invalid parameter"); |
} else { //remove this failover sometime after release of client 0.6.4 |
50 |
return; |
String sections[] = train.split(" "); |
51 |
|
if (sections.length != 2) { |
52 |
|
response.sendError(400, "Invalid parameter"); |
53 |
|
return; |
54 |
|
} |
55 |
|
|
56 |
|
type = lookupType(sections[0]); |
57 |
|
trainID = sections[1]; |
58 |
} |
} |
59 |
|
|
|
String type = lookupType(sections[0]); |
|
|
String trainID = sections[1]; |
|
60 |
try |
try |
61 |
{ |
{ |
62 |
List<TimetableBean> timetable = fetcher.cachedLookupTimetable(trainID, type); |
List<TimetableBean> timetable = fetcher.cachedLookupTimetable(trainID, type); |
77 |
} |
} |
78 |
|
|
79 |
} |
} |
80 |
|
/*remove /outcomment/deprecate after 0.6.4 release */ |
81 |
String lookupType(String trainCode) { |
String lookupType(String trainCode) { |
82 |
trainCode = trainCode.toLowerCase(); |
trainCode = trainCode.toLowerCase(); |
83 |
|
|