use of com.google.api.services.calendar.Calendar.Events.Delete in project drbookings by DrBookings.
the class GoogleCalendarSync method clearEvent.
private static void clearEvent(final String calendarId, final Event event) throws IOException {
if (isDrBookingEvent(event)) {
if (logger.isInfoEnabled()) {
logger.info("Deleting " + event.getSummary());
}
final Delete d = client.events().delete(calendarId, event.getId());
d.execute();
}
}
use of com.google.api.services.calendar.Calendar.Events.Delete in project drbookings by DrBookings.
the class GoogleCalendarSync method clearEvent.
private static void clearEvent(final String calendarId, final BookingBean b) throws IOException {
for (final Iterator<String> it = b.getCalendarIds().iterator(); it.hasNext(); ) {
final String id = it.next();
final Delete d = client.events().delete(calendarId, id);
if (logger.isDebugEnabled()) {
logger.debug("Deleting " + d.getEventId());
}
try {
d.execute();
} catch (final GoogleJsonResponseException e) {
if (logger.isErrorEnabled()) {
logger.error(e.toString());
}
}
it.remove();
}
}
Aggregations