Examples of XmlHandler


Examples of com.esri.gpt.framework.http.XmlHandler

    InputStream wrappedStream = null;
    try {

      HttpClientRequest cr = new HttpClientRequest();
      cr.setUrl(url);
      XmlHandler sh = new XmlHandler(false);
      cr.setContentHandler(sh);
      cr.setCredentialProvider(cp != null ? cp : CredentialProvider.getThreadLocalInstance());
      cr.execute();

      return sh.getDocument();
    } catch (IllegalArgumentException ex) {
      LogUtil.getLogger().log(Level.FINER, "Error accessing host: " + url, ex);
      return null;
    } catch (IOException ex) {
      LogUtil.getLogger().log(Level.FINER, "Error accessing host: " + url, ex);
View Full Code Here

Examples of com.esri.gpt.framework.http.XmlHandler

  LOGGER.finer("Advancing to the next group of records.");
  try {
    HttpClientRequest cr = new HttpClientRequest();
    cr.setUrl(info.newListIdsUrl(resumptionToken, criteria.getFromDate(), criteria.getToDate()));

    XmlHandler sh = new XmlHandler(false);
    cr.setContentHandler(sh);
    cr.setCredentialProvider(info.newCredentialProvider());
    cr.execute();
    Document doc = sh.getDocument();

    XPath xPath = XPathFactory.newInstance().newXPath();
    NodeList nodeList = (NodeList) xPath.evaluate("/OAI-PMH/ListIdentifiers/header", doc, XPathConstants.NODESET);

    boolean maxReached = false;
View Full Code Here

Examples of com.esri.gpt.framework.http.XmlHandler

      try {
        LOGGER.log(Level.FINER, "Loading folder content of {0}", info.getUrl());

        HttpClientRequest cr = new HttpClientRequest();
        cr.setUrl(info.getUrl());
        XmlHandler sh = new XmlHandler(false);
        cr.setContentHandler(sh);
        cr.setBatchHttpClient(info.getBatchHttpClient());
        cr.execute();

        iterator = parseResponse(sh.getDocument()).iterator();

        LOGGER.log(Level.FINER, "Loading folder content of {0} completed.", info.getUrl());
      } catch (Exception ex) {
        noMore = true;
        iterator = null;
View Full Code Here

Examples of com.esri.gpt.framework.http.XmlHandler

  LOGGER.finer("Reading metadata of source URI: \"" +sourceUri+ "\" through proxy: "+this);
  try {
    sourceUri = Val.chkStr(sourceUri).replaceAll("\\{", "%7B").replaceAll("\\}", "%7D");
    HttpClientRequest cr = new HttpClientRequest();
    cr.setUrl(info.newReadMetadataUrl(sourceUri));
    XmlHandler sh = new XmlHandler(false);
    cr.setContentHandler(sh);
    cr.setCredentialProvider(info.newCredentialProvider());
    cr.setBatchHttpClient(info.getBatchHttpClient());
    cr.execute();
    Document doc = sh.getDocument();
    XPath xPath = XPathFactory.newInstance().newXPath();
    Node node = (Node) xPath.evaluate(
        "/OAI-PMH/GetRecord/record/metadata",
        doc, XPathConstants.NODE);
    Node elementNode = null;
View Full Code Here

Examples of com.esri.gpt.framework.http.XmlHandler

private void advanceToNextRecords() throws IOException {
  LOGGER.finer("Advancing to the next group of records.");
  try {
    HttpClientRequest cr = new HttpClientRequest()
    cr.setUrl(info.newUrl(startIndex, itemsPerPage));
    XmlHandler sh = new XmlHandler(true);
    cr.setContentHandler(sh);
    cr.setCredentialProvider(info.newCredentialProvider());
    try{
      cr.execute();
    }catch (HttpClientException hcex){
      if(hcex.getHttpStatusCode() == 404){       
        cr.setUrl(info.newUrl(-1, -1));
          sh = new XmlHandler(true);
          cr.setContentHandler(sh);
          cr.setCredentialProvider(info.newCredentialProvider());
          cr.execute();
          noMore = true;
      }
    }
    Document doc = sh.getDocument();
    XPath xPath = XPathFactory.newInstance().newXPath();
    xPath.setNamespaceContext(makeNamespaceContext());
    NodeList entries = (NodeList) xPath.evaluate("/atom:feed/atom:entry", doc, XPathConstants.NODESET);

    String entryProcessorClassName = info.getEntryProcessorClassName();
View Full Code Here

Examples of com.hp.hpl.jena.rdf.arp.impl.XMLHandler

  }
  @Override
    protected void runTest() {
        Attributes noAtts = new Atts();
    final StringBuffer buf = new StringBuffer();
    XMLHandler arp = new XMLHandler();
    arp.getHandlers().setErrorHandler(new ErrorHandler() {

      @Override
            public void warning(SAXParseException exception) {
        buf.append(exception.getMessage());
        buf.append("\n");
      }

      @Override
            public void error(SAXParseException e) {
        warning(e);
      }

      @Override
            public void fatalError(SAXParseException e) {
        warning(e);
      }

    });
    try {
    arp.initParse("http://example.org/","");
        arp.startElement(RDF.getURI(),"RDF","rdf:RDF",noAtts);
        arp.startElement(RDF.getURI(),"Description","rdf:Description",noAtts);
        arp.startElement(RDF.getURI(),"value","rdf:value",testAtts);
        }
    catch (SAXException e){
     
    }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.arp.impl.XMLHandler

  }
  @Override
    protected void runTest() {
        Attributes noAtts = new Atts();
    final StringBuffer buf = new StringBuffer();
    XMLHandler arp = new XMLHandler();
    arp.getHandlers().setErrorHandler(new ErrorHandler() {

      @Override
            public void warning(SAXParseException exception) {
        buf.append(exception.getMessage());
        buf.append("\n");
      }

      @Override
            public void error(SAXParseException e) {
        warning(e);
      }

      @Override
            public void fatalError(SAXParseException e) {
        warning(e);
      }

    });
    try {
    arp.initParse("http://example.org/","");
        arp.startElement(RDF.getURI(),"RDF","rdf:RDF",noAtts);
        arp.startElement(RDF.getURI(),"Description","rdf:Description",noAtts);
        arp.startElement(RDF.getURI(),"value","rdf:value",testAtts);
        }
    catch (SAXException e){
     
    }
View Full Code Here

Examples of edu.harvard.hul.ois.jhove.handler.XmlHandler

          jhove = new JhoveBase ();
          jhove.init (jhoveConf, "org.apache.xerces.parsers.SAXParser");
          jhove.setChecksumFlag(false)
        jhove.setSignatureFlag(false);
        jhove.setShowRawFlag(false);
          xh = new XmlHandler();
          jhoveApp = new App ("Jhove","1.5", new int[] {2009, 12, 23}, "","");
      xh.setApp(jhoveApp);
      xh.setBase(jhove);       
    }
    catch (JhoveException e) {
View Full Code Here

Examples of edu.harvard.hul.ois.jhove.handler.XmlHandler

           

            // load all module
            Module module = null;

            XmlHandler aboutHandler = new XmlHandler();
            OutputStream out = newOutputStream(new StringBuffer());
            aboutHandler.setWriter(new PrintWriter(out));
            String s = new File(filePathName).toURI().toString();
            String[] dirFileOrUri = new String[] { s };

            // execute jhove
            jhove.dispatch(app, module, aboutHandler, aboutHandler, outputFile,
View Full Code Here

Examples of ee.ut.goblin.views.XMLHandler

    File it = new File(proj.getLocation().addTrailingSeparator() + "goblin.xml");
    if (! it.canRead())
      return new Status(IStatus.ERROR, "ee.ut.goblin", 97, "Can't read analysis file.", null);
   
    DefaultHandler handler = new XMLHandler(root);
    SAXParserFactory factory = SAXParserFactory.newInstance();
   
    try {
      // Parse the input
      SAXParser saxParser = factory.newSAXParser();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.