use of com.google.api.services.calendar.model.CalendarListEntry in project muikku by otavanopisto.
the class GoogleCalendarClient method listPublicCalendars.
public List<fi.otavanopisto.muikku.calendar.Calendar> listPublicCalendars() throws CalendarServiceException {
try {
Calendar client = getClient();
ArrayList<fi.otavanopisto.muikku.calendar.Calendar> result = new ArrayList<>();
for (CalendarListEntry entry : client.calendarList().list().execute().getItems()) {
result.add(new GoogleCalendar(entry.getSummary(), entry.getDescription(), entry.getId(), isWritable(entry)));
}
return result;
} catch (IOException | GeneralSecurityException ex) {
throw new CalendarServiceException(ex);
}
}
Aggregations