List<GtfsBundle> bundles = UtilityLibrary.getGtfsBundlesForArguments(paths);
for (GtfsBundle bundle : bundles) {
GtfsReader reader = new GtfsReader();
reader.setDefaultAgencyId(bundle.getDefaultAgencyId());
reader.setInputLocation(bundle.getPath());
for (Map.Entry<String, String> entry : bundle.getAgencyIdMappings().entrySet())
reader.addAgencyIdMapping(entry.getKey(), entry.getValue());
reader.getEntityClasses().retainAll(
Arrays.asList(Agency.class, Stop.class));
reader.addEntityHandler(handler);
reader.run();
}
Set<AgencyAndId> ids = handler.getIds();
InputStream in = IOLibrary.getPathAsInputStream(args[0]);
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
String line = null;
while ((line = reader.readLine()) != null) {
if (line.startsWith("#") || line.startsWith("{{{")
|| line.startsWith("}}}") || line.length() == 0)
continue;
String[] tokens = line.split("\\s+");
AgencyAndId id = AgencyAndIdLibrary.convertFromString(tokens[0]);