mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 00:39:58 +00:00
Extract JSON get stops parameters to method
This commit is contained in:
parent
4a7743d094
commit
7acd4a0afa
21 changed files with 95 additions and 106 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue