private static GoogleTransitData DoTask()
{
List<GoogleRoute> routes = null;
List<GoogleRouteSchedule> schedules = null;
using (var archive = new ZipArchive(GetZipFile()))
{
var routesEntry = archive.GetEntry("routes.txt");
if (routesEntry == null)
{
throw new FileNotFoundException("The Google Transit archive did not contain routes.txt.");
}
var scheduleEntry = archive.GetEntry("stop_times.txt");
if (scheduleEntry == null)
{
throw new FileNotFoundException("The Google Transit archive did not contain stop_times.txt.");
}
routes = ParseRouteCSV(routesEntry);
schedules = ParseScheduleCSV(scheduleEntry);
}
return new GoogleTransitData
{
Routes = routes,
Schedules = schedules
};
}