use of org.mycore.common.content.MCRSourceContent in project mycore by MyCoRe-Org.
the class MCRRealmFactory method getRealms.
private static Document getRealms() throws JDOMException, TransformerException, SAXException, IOException {
if (realmsFile == null) {
return MCRSourceContent.getInstance(realmsURI.toASCIIString()).asXML();
}
if (!realmsFile.exists() || realmsFile.length() == 0) {
LOGGER.info("Creating {}...", realmsFile.getAbsolutePath());
MCRSourceContent realmsContent = MCRSourceContent.getInstance(RESOURCE_REALMS_URI);
realmsContent.sendTo(realmsFile);
}
updateLastModified();
return MCRXMLParserFactory.getNonValidatingParser().parseXML(new MCRFileContent(realmsFile));
}
use of org.mycore.common.content.MCRSourceContent in project mycore by MyCoRe-Org.
the class MCRXMLFunctions method document.
public static Node document(String uri) throws JDOMException, IOException, SAXException, TransformerException {
MCRSourceContent sourceContent = MCRSourceContent.getInstance(uri);
if (sourceContent == null) {
throw new TransformerException("Could not load document: " + uri);
}
DOMOutputter out = new DOMOutputter();
return out.output(sourceContent.asXML());
}
Aggregations