Search in sources :

Example 1 with TimeZoneInfo

use of org.bedework.icalendar.Icalendar.TimeZoneInfo in project bw-calendar-engine by Bedework.

the class IcalTranslator method doTimeZone.

private TimeZoneInfo doTimeZone(final VTimeZone vtz) throws CalFacadeException {
    TzId tzid = vtz.getTimeZoneId();
    if (tzid == null) {
        throw new CalFacadeException("Missing tzid property");
    }
    String id = tzid.getValue();
    try {
        TimeZone tz = Timezones.getTz(id);
        String tzSpec = null;
        if (tz == null) {
            tz = new TimeZone(vtz);
            tzSpec = vtz.toString();
        }
        return new TimeZoneInfo(id, tz, tzSpec);
    } catch (Throwable t) {
        throw new CalFacadeException(t);
    }
}
Also used : TimeZone(net.fortuna.ical4j.model.TimeZone) VTimeZone(net.fortuna.ical4j.model.component.VTimeZone) TimeZoneInfo(org.bedework.icalendar.Icalendar.TimeZoneInfo) TzId(net.fortuna.ical4j.model.property.TzId) CalFacadeException(org.bedework.calfacade.exc.CalFacadeException)

Aggregations

TimeZone (net.fortuna.ical4j.model.TimeZone)1 VTimeZone (net.fortuna.ical4j.model.component.VTimeZone)1 TzId (net.fortuna.ical4j.model.property.TzId)1 CalFacadeException (org.bedework.calfacade.exc.CalFacadeException)1 TimeZoneInfo (org.bedework.icalendar.Icalendar.TimeZoneInfo)1