Get String content of the editor takes a long time
Posted: Fri Sep 09, 2016 6:44 pm
Hi everyone,
I'm using the last oxygen SDK (18.0.0.3). I try to get the string content of my current page. My current page is a large XML file (about 700 k) and I want to get the string content during the edition of the document (before saving).
In order to do so, I used this code :
The string is available (just before "writeStringToFile" method) after more than 30 seconds... Why is the reader so long to get this string content ?
Thanks for your help,
Johann
I'm using the last oxygen SDK (18.0.0.3). I try to get the string content of my current page. My current page is a large XML file (about 700 k) and I want to get the string content during the edition of the document (before saving).
In order to do so, I used this code :
Code: Select all
File tempFile = File.createTempFile("tempfile", ".XML");
tempFile.deleteOnExit();
Reader reader = wsEditor.createContentReader();
String xmlContent = "";
int data = reader.read();
while (data != -1) {
char dataChar = (char) data;
xmlContent += dataChar;
data = reader.read();
}
FileUtils.writeStringToFile(tempFile, xmlContent);
Thanks for your help,
Johann