use of org.mycore.common.content.MCRVFSContent in project mycore by MyCoRe-Org.
the class MCRFileCollection method readAdditionalData.
private void readAdditionalData() throws IOException {
FileObject src = VFS.getManager().resolveFile(fo, dataFile);
if (!src.exists()) {
LOGGER.warn("Metadata file is missing, repairing metadata...");
data = new Element("collection");
new Document(data);
repairMetadata();
}
try {
data = new MCRVFSContent(src).asXML().getRootElement();
} catch (JDOMException | SAXException e) {
throw new IOException(e);
}
}
use of org.mycore.common.content.MCRVFSContent in project mycore by MyCoRe-Org.
the class MCRCategLinkServiceImplTest method loadWorldClassification.
private void loadWorldClassification() throws URISyntaxException, MCRException, SAXParseException, IOException {
URL worlClassUrl = this.getClass().getResource(WORLD_CLASS_RESOURCE_NAME);
Document xml = MCRXMLParserFactory.getParser().parseXML(new MCRVFSContent(worlClassUrl));
category = MCRXMLTransformer.getCategory(xml);
}
use of org.mycore.common.content.MCRVFSContent in project mycore by MyCoRe-Org.
the class MCRCStoreVFS method doRetrieveMCRContent.
protected MCRContent doRetrieveMCRContent(MCRFile file) throws IOException {
FileObject targetObject = fsManager.resolveFile(getBase(), file.getStorageID());
MCRVFSContent content = new MCRVFSContent(targetObject);
content.setName(file.getName());
return content;
}
use of org.mycore.common.content.MCRVFSContent in project mycore by MyCoRe-Org.
the class MCRCategoryDAOImplTest method loadClassificationResource.
public static MCRCategory loadClassificationResource(String resourceName) throws SAXParseException, IOException, URISyntaxException {
URL classResourceUrl = MCRCategoryDAOImplTest.class.getResource(resourceName);
Document xml = MCRXMLParserFactory.getParser().parseXML(new MCRVFSContent(classResourceUrl));
return MCRXMLTransformer.getCategory(xml);
}
use of org.mycore.common.content.MCRVFSContent in project mycore by MyCoRe-Org.
the class MCRCategoryImplTest method loadWorldClassification.
/**
* @throws URISyntaxException
* @throws SAXParseException
* @throws MCRException
*/
private void loadWorldClassification() throws URISyntaxException, MCRException, SAXParseException, IOException {
URL worlClassUrl = this.getClass().getResource(WORLD_CLASS_RESOURCE_NAME);
Document xml = MCRXMLParserFactory.getParser().parseXML(new MCRVFSContent(worlClassUrl));
category = MCRCategoryImpl.wrapCategory(MCRXMLTransformer.getCategory(xml), null, null);
category.calculateLeftRightAndLevel(1, 0);
}
Aggregations