Search in sources :

Example 1 with UnknownAgencyTimezoneException

use of org.onebusaway.gtfs.impl.calendar.UnknownAgencyTimezoneException in project OpenTripPlanner by opentripplanner.

the class CalendarServiceDataFactoryImpl method setTimeZonesForAgencies.

private void setTimeZonesForAgencies(CalendarServiceData data) {
    for (Agency agency : _dao.getAllAgencies()) {
        TimeZone timeZone = TimeZone.getTimeZone(agency.getTimezone());
        if (timeZone.getID().equals("GMT") && !agency.getTimezone().toUpperCase().equals("GMT")) {
            throw new UnknownAgencyTimezoneException(agency.getName(), agency.getTimezone());
        }
        data.putTimeZoneForAgencyId(agency.getId(), timeZone);
    }
}
Also used : TimeZone(java.util.TimeZone) Agency(org.onebusaway.gtfs.model.Agency) UnknownAgencyTimezoneException(org.onebusaway.gtfs.impl.calendar.UnknownAgencyTimezoneException)

Aggregations

TimeZone (java.util.TimeZone)1 UnknownAgencyTimezoneException (org.onebusaway.gtfs.impl.calendar.UnknownAgencyTimezoneException)1 Agency (org.onebusaway.gtfs.model.Agency)1