Package org.vfny.geoserver.wcs.requests

Examples of org.vfny.geoserver.wcs.requests.CoverageHandler


        throws WcsException {
        // translate string into a proper SAX input source
        InputSource requestSource = new InputSource(reader);

        // instantiante parsers and content handlers
        CoverageHandler contentHandler = new CoverageHandler((WCSInfo)getService());

        // read in XML file and parse to content handler
        try {
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.finest("about to create parser");
            }

            SAXParserFactory factory = SAXParserFactory.newInstance();
            SAXParser parser = factory.newSAXParser();
            ParserAdapter adapter = new ParserAdapter(parser.getParser());

            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.finest("setting the content handler");
            }

            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.finest("content handler = " + contentHandler);
            }

            adapter.setContentHandler(contentHandler);

            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.finest("about to parse");
            }

            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.finest("calling parse on " + requestSource);
            }

            adapter.parse(requestSource);

            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("just parsed: " + requestSource);
            }
        } catch (SAXException e) {
            throw new WcsException(e, "XML getCoverage request SAX parsing error",
                XmlRequestReader.class.getName());
        } catch (IOException e) {
            throw new WcsException(e, "XML get coverage request input error",
                XmlRequestReader.class.getName());
        } catch (ParserConfigurationException e) {
            throw new WcsException(e, "Some sort of issue creating parser",
                XmlRequestReader.class.getName());
        }

        Request r = contentHandler.getRequest(req);

        if (r.getService() != null) {
            final String service = r.getService();

            if (!service.trim().toUpperCase().startsWith("WCS")) {
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.wcs.requests.CoverageHandler

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.