Package ORG.oclc.oai.server.catalog.helpers

Examples of ORG.oclc.oai.server.catalog.helpers.RecordStringHandler


                    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();
View Full Code Here

TOP

Related Classes of ORG.oclc.oai.server.catalog.helpers.RecordStringHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.