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")) {