e.printStackTrace();
throw new IOException(e.getMessage());
}
}
RecordStringHandler rsh = new RecordStringHandler();
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
factory.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
SAXParser saxParser = factory.newSAXParser();
InputStream in;
try {
in = new FileInputStream(sourceFile);
} catch (FileNotFoundException e) {
in = Thread.currentThread().getContextClassLoader().getResourceAsStream(sourceFile);
}
saxParser.parse(in, rsh);
// saxParser.parse(new File(sourceFile), rsh);
// build the indexes
nativeMap = rsh.getNativeRecords();
} catch (SAXException e) {
e.printStackTrace();
throw new IOException(e.getMessage());
} catch (ParserConfigurationException e) {
e.printStackTrace();