Extract JSON get stops parameters to method

This commit is contained in:
Andreas Schildbach 2013-07-09 00:44:04 +02:00
parent 4a7743d094
commit 7acd4a0afa
21 changed files with 95 additions and 106 deletions

View file

@ -287,14 +287,12 @@ public class SeptaProvider extends AbstractHafasProvider
}
}
private static final String AUTOCOMPLETE_URI = API_BASE
+ "ajax-getstop.exe/dny?start=1&tpl=suggest2json&REQ0JourneyStopsS0A=255&REQ0JourneyStopsB=12&S=%s?&js=true&";
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
final String uri = String.format(Locale.ENGLISH, AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), ISO_8859_1));
final StringBuilder uri = new StringBuilder(getStopEndpoint);
uri.append(jsonGetStopsParameters(constraint));
return jsonGetStops(uri);
return jsonGetStops(uri.toString());
}
@Override