I want to change the contents of a page in a Confluence server plugin. All the sample code I found was involving a Page object, but it seems since version 7.3 more or less all methods providing a Page object e. g. in PageManager are deprecated in favor of ContentService.find(...) methods. These work fine, and I can read the body contents. However, I found no way to change the body of a Content object. I found ContentManager has an update(content) method, but I did not find any way to change a Content or ContentBody object, they seem to be read only.
How can I update the body of a page?
Apart from the deprecated methods like
pageManager.saveNewVersion(page, p -> pageObject.setBodyAsString(...))
I only found the REST API call
PUT /rest/api/content/{contentId}But it seems strange to have to go through a client call in order to just change the content body.