API.WebClients.GoogleTransitClient.DoTask C# (CSharp) Method

DoTask() private static method

Downloads and interprets the ZIP file CTS uploads for Google. This is primarily to get route colors and route schedules.
private static DoTask ( ) : GoogleTransitData
return GoogleTransitData
        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
            };
        }