@Override
public Entry updateEntry(RequestContext request, Object entryId, Entry entry)
throws FeedServerAdapterException {
String entityFilePath = getEntityFilePath(entryId);
if (!fileUtil.exists(entityFilePath)) {
throw new FeedServerAdapterException(
FeedServerAdapterException.Reason.ENTRY_DOES_NOT_EXIST,
"entry " + entryId + " does not exist");
}
Map<String, Object> properties = getPropertyMapForEntry(entry);
String entityFileContent = xmlUtil.convertPropertiesToXml(properties);
try {
fileUtil.writeFileContents(entityFilePath, entityFileContent);
return entry;
} catch (IOException e) {
throw new FeedServerAdapterException(
FeedServerAdapterException.Reason.IO_ERROR, e.getMessage());
}
}