/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableServlet.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableServlet.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 696 by torben, Fri Feb 5 13:57:39 2010 UTC revision 697 by torben, Mon May 3 07:42:02 2010 UTC
# Line 41  public class TimetableServlet extends Ht Line 41  public class TimetableServlet extends Ht
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);
# Line 70  public class TimetableServlet extends Ht Line 77  public class TimetableServlet extends Ht
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                                    

Legend:
Removed from v.696  
changed lines
  Added in v.697

  ViewVC Help
Powered by ViewVC 1.1.20