For those having the same problems, here's a solution.
Update events need to be made with a
PUT request. And you need to set the If-Match/etag correctly (I will disregard if someone has updated the event so I set it to "*"). You will need to make the following additions to the Google API Java Client:
In your GDataClient.java add the following method:
protected final <T> T executePut(GoogleUrl url, AbstractHttpContent content, Class<T> parseAsType, String etag) throws IOException {
prepareUrl(url, parseAsType);
HttpRequest request = getRequestFactory().buildPutRequest(url, content);
setIfMatch(request, etag);
return execute(request).parseAs(parseAsType);
}
In your GDataXmlClient.java add the following method:
protected final <T> T executePut(GoogleUrl url, T content, String etag) throws IOException {
AtomContent atomContent = AtomContent.forEntry(namespaceDictionary, content);
@SuppressWarnings("unchecked")
Class<T> parseAsType = (Class<T>) content.getClass();
return executePut(url, atomContent, parseAsType, etag);
}
In your CalendarClient.java add this method to the EventCollection class:
/** Update request. */
public class UpdateRequest {
public EventEntry execute(EventEntry updated) throws IOException {
CalendarUrl url = new CalendarUrl(updated.getEditLink());
return executePut(url, updated, "*");
}
}
This will enable you to make update requests like this:
EventEntry entry = existingEntry.clone();
// now make any changes to you entry
client.eventFeed().update().execute(entry);
Good luck.
Mike