I am using the following code to create a page on Confluence 4.3:
public void publish() throws IOException {
DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
Date today = Calendar.getInstance().getTime();
XWikiXmlRpcClient rpc = new XWikiXmlRpcClient(CONFLUENCE_URI);
try {
rpc.login(USER_NAME, PASSWORD);
Page page = new Page();
page.setSpace(owrConf.getString(ConfigKeys.CONFLUENCE_SPACE));
page.setTitle(owrConf.getString(ConfigKeys.CONFLUENCE_PAGE_TITLE) + "_" + df.format(today));
List<String> lines = Files.readAllLines(Paths.get("summary.markup"), Charset.defaultCharset());
StringBuilder b = new StringBuilder();
for(int i=0; i < lines.size(); i++) {
b.append(String.format("%s%s", lines.get(i), "\r\n"));
}
page.setContent(b.toString());
page.setParentId(owrConf.getString(ConfigKeys.CONFLUENCE_PAGE_ID));
rpc.storePage(page);
} catch (XmlRpcException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
This works fine, but I am just wondering if I can update an existing page instead of always creating a new one. I can't find API information for Confluence 4.3 to do this.