col.removeResource(document);
System.out.println("document removed.");
}
private Document updateDocument(String updateFile) throws Exception {
XUpdateQueryService service =
(XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
// Read XUpdate-Modifcations
System.out.println("update file: " + updateFile);
File file = new File(updateFile);
BufferedReader br = new BufferedReader(new FileReader(file));
char[] characters = new char[new Long(file.length()).intValue()];
br.read(characters, 0, Long.valueOf(file.length()).intValue());
br.close();
String xUpdateModifications = new String(characters);
System.out.println("modifications: " + xUpdateModifications);
//
service.update(xUpdateModifications);
//col.setProperty("pretty", "true");
//col.setProperty("encoding", "UTF-8");
XMLResource ret = (XMLResource) col.getResource(XUPDATE_FILE);
String xmlString = ((String) ret.getContent());