Package org.fao.geonet.exceptions

Examples of org.fao.geonet.exceptions.BadXmlResponseEx


    //--- post the query to the remote site
      Element xml = Xml.loadFile(new URL(params.url), xmlQuery);
     
      if (xml == null) {
        throw new BadXmlResponseEx("No response or problem getting response from "+params.url+":\n"+Xml.getString(xmlQuery));
      }

      //--- apply stylesheet from output schema - stylesheet can be optional
      //--- in case the server can do XSL transformations for us (eg. deegree
      //--- 2.2)
View Full Code Here


    //--- load catalog
    InvCatalogFactory factory = new InvCatalogFactory("default", true);
    catalog = (InvCatalogImpl) factory.readXML(params.url);
    StringBuilder buff = new StringBuilder();
    if (!catalog.check(buff, true)) {
      throw new BadXmlResponseEx("Invalid catalog "+ params.url+"\n"+buff.toString());
    }

    //--- display catalog read in log file
    log.info("Catalog read from "+params.url+" is \n"+factory.writeXML(catalog));
    String serviceStyleSheet = context.getAppPath() + Geonet.Path.IMPORT_STYLESHEETS + "/ThreddsCatalog-to-ISO19119_ISO19139.xsl";
View Full Code Here

 
   private Element addKeywords (Element md, Element keywords) throws Exception {
    Element root  = (Element)md.getChild("identificationInfo", gmd).getChildren().get(0);
    boolean ok = addAfter(root, keywords, "descriptiveKeywords", gmd);
    if (!ok) {
      throw new BadXmlResponseEx("The metadata did not have a descriptiveKeywords Element");
    }
    return md;
  }
View Full Code Here

  public HarvestSummary harvest(Element fragments, String harvestUri) throws Exception {
    this.harvestUri = harvestUri;
    harvestSummary = new HarvestSummary();
    if (fragments == null || !fragments.getName().equals("records")) {
      throw new BadXmlResponseEx("<records> not found in response: \n"+Xml.getString(fragments));
    }

    //--- Loading categories and groups
    localCateg   = new CategoryMapper (context);
    localGroups = new GroupMapper (context);
View Full Code Here

      return Xml.loadStream(new ByteArrayInputStream(data));
    }

    catch(JDOMException e)
    {
      throw new BadXmlResponseEx("Response: '" + new String(data, "UTF8") + "' (from URI " + httpMethod.getURI() + ")");
    }

    finally
    {
      httpMethod.releaseConnection();
View Full Code Here

TOP

Related Classes of org.fao.geonet.exceptions.BadXmlResponseEx

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.