Plus plus = new Plus.Builder(TRANSPORT, JSON_FACTORY, credential)
.setApplicationName(Constants.GOOGLE_APPLICATION_NAME)
.build();
// Re-acquisition of Activity
Activity activity = null;
try {
activity = plus.activities().get(activityModel.getKey().getName()).execute();
} catch (GoogleJsonResponseException e) {
// When deleted
if(e.getStatusCode() == 404) {
// logger.info("Activity Delete");
delete(userModel, activityModel);
return true;
}
}
if(activity != null) {
Date oldModelUpdateDate = activityModel.getUpdated();
Date newModelUpdateDate = new Date(activity.getUpdated().getValue());
// Activity Is Updated
if(!oldModelUpdateDate.equals(newModelUpdateDate)) {
// logger.info("Activity Update!");
// Replace Activity And UpdateCheckDate