public List < GoogleCalendar > getCalendars ( ) throws IOException { List < CalendarListEntry > calendarListEntries = dao . calendarList ( ) . list ( ) . execute ( ) . getItems ( ) ; List < GoogleCalendar > calendars = new ArrayList <> ( ) ; if ( calendarListEntries != null && ! calendarListEntries . isEmpty ( ) ) { for ( int i = 0 ; i < calendarListEntries . size ( ) ; i ++ ) { CalendarListEntry calendarListEntry = calendarListEntries . get ( i ) ; GoogleCalendar calendar = converter . convert ( calendarListEntry , GoogleCalendar . class ) ; calendar . setStyle ( com . calendarfx . model . Calendar . Style . getStyle ( i ) ) ; calendars . add ( calendar ) ; } } return calendars ; }
Gets the list of all calendars available in the account .