XMLReader reader = XMLReaderFactory.createXMLReader();
Map<String, IndexAction> logContent = contentMap;
if(logContent == null)
logContent = new HashMap<String,IndexAction>(64);
reader.setContentHandler(new IndexLogContentHandler(logContent));
InputSource source = new InputSource(new FileInputStream(indexLogFile));
try{
reader.parse(source);
}catch (SAXException e) {
/*
* try to append the Root element end
* this happens if the server crashes.
* If it dies while writing an entry the log file has to be fixed manually
*/
IndexLogWriter.tryCloseRoot(indexLogFile);
source = new InputSource(new FileInputStream(indexLogFile));
reader.parse(source);
}
return logContent;