Search in sources :

Example 61 with CSFileInputStream

use of org.hl7.fhir.utilities.CSFileInputStream in project org.hl7.fhir.core by hapifhir.

the class Translations method load.

/**
 * Load from the XML translations file maintained by the FHIR project
 *
 * @param filename
 * @throws IOException
 * @throws SAXException
 * @throws FileNotFoundException
 * @throws ParserConfigurationException
 * @throws Exception
 */
public void load(String filename) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    loadMessages(builder.parse(new CSFileInputStream(filename)));
}
Also used : DocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory) DocumentBuilder(javax.xml.parsers.DocumentBuilder) CSFileInputStream(org.hl7.fhir.utilities.CSFileInputStream)

Example 62 with CSFileInputStream

use of org.hl7.fhir.utilities.CSFileInputStream in project org.hl7.fhir.core by hapifhir.

the class Translations method load.

/**
 * Load from the XML translations file maintained by the FHIR project
 *
 * @param filename
 * @throws IOException
 * @throws SAXException
 * @throws FileNotFoundException
 * @throws ParserConfigurationException
 * @throws Exception
 */
public void load(String filename) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    loadMessages(builder.parse(new CSFileInputStream(filename)));
}
Also used : DocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory) DocumentBuilder(javax.xml.parsers.DocumentBuilder) CSFileInputStream(org.hl7.fhir.utilities.CSFileInputStream)

Aggregations

CSFileInputStream (org.hl7.fhir.utilities.CSFileInputStream)60 FHIRException (org.hl7.fhir.exceptions.FHIRException)34 CSFile (org.hl7.fhir.utilities.CSFile)33 File (java.io.File)28 FileOutputStream (java.io.FileOutputStream)28 TextFile (org.hl7.fhir.utilities.TextFile)26 FileInputStream (java.io.FileInputStream)20 XmlParser (org.hl7.fhir.r5.formats.XmlParser)17 DocumentBuilder (javax.xml.parsers.DocumentBuilder)16 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)16 IOException (java.io.IOException)14 ByteArrayOutputStream (java.io.ByteArrayOutputStream)10 XLSXmlParser (org.hl7.fhir.utilities.xls.XLSXmlParser)10 Document (org.w3c.dom.Document)10 FileNotFoundException (java.io.FileNotFoundException)8 ByteArrayInputStream (java.io.ByteArrayInputStream)7 JsonParser (org.hl7.fhir.r5.formats.JsonParser)7 Resource (org.hl7.fhir.r5.model.Resource)7 IniFile (org.hl7.fhir.utilities.IniFile)7 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)6