use of org.olat.core.util.xml.XMLParser in project openolat by klemens.
the class CPManifestTreeModel method loadDocument.
private Document loadDocument(String documentStr) throws IOException {
InputStream in = null;
Document doc = null;
try {
in = new ByteArrayInputStream(documentStr.getBytes());
XMLParser xmlParser = new XMLParser(new IMSEntityResolver());
doc = xmlParser.parse(in, false);
in.close();
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw new IOException("could not read and parse from string " + documentStr, e);
} finally {
IOUtils.closeQuietly(in);
}
return doc;
}
use of org.olat.core.util.xml.XMLParser in project openolat by klemens.
the class CPManifestTreeModel method loadDocument.
private Document loadDocument(VFSLeaf documentF) throws IOException {
InputStream in = null;
Document doc = null;
try {
in = documentF.getInputStream();
XMLParser xmlParser = new XMLParser(new IMSEntityResolver());
doc = xmlParser.parse(in, false);
in.close();
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw new IOException("could not read and parse from file " + documentF, e);
} finally {
IOUtils.closeQuietly(in);
}
return doc;
}
Aggregations