Package org.apache.xml.security.utils.resolver

Examples of org.apache.xml.security.utils.resolver.ResourceResolver


        DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  Attr uriAttr = doc.createAttribute("URI");
  String basedir = System.getProperty("basedir");
  String file = new File(basedir, "build.xml").toURI().toString();
  uriAttr.setValue(file);
  ResourceResolver res = ResourceResolver.getInstance(uriAttr, file);
  try {
      res.resolve(uriAttr, "");
  } catch (Exception e) {
      fail(e.getMessage());
  }
    }
View Full Code Here


  ResourceResolver.registerAtStart(className);
  Document doc =
        DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  Attr uriAttr = doc.createAttribute("URI");
  uriAttr.setValue("http://www.apache.org");
  ResourceResolver res =
      ResourceResolver.getInstance(uriAttr, "http://www.apache.org");
  try {
      uriAttr.setValue("http://xmldsig.pothole.com/xml-stylesheet.txt");
      res.resolve(uriAttr, null);
  } catch (Exception e) {
      e.printStackTrace();
      fail(uriAttr.getValue()
    + " should be resolvable by the OfflineResolver");
  }
  try {
      uriAttr.setValue("http://www.apache.org");
      res.resolve(uriAttr, null);
      fail(uriAttr.getValue()
    + " should not be resolvable by the OfflineResolver");
  } catch (Exception e) { }
    }
View Full Code Here

    Document doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();   
    Attr uri=doc.createAttribute("id");
    uri.setNodeValue("urn:ddd:uuu");
    ((Element)doc.createElement("test")).setAttributeNode(uri);
    try {
      ResourceResolver resolver=ResourceResolver.getInstance(uri, null);     
      fail("No exception throw, but resolver found:"+resolver);
    } catch (ResourceResolverException e) {
     
    }
  }
View Full Code Here

    ((Element)doc.createElement("test")).setAttributeNode(uri);
    Attr uri1=doc.createAttribute("id");
    uri1.setNodeValue("!!!test=2");
    doc.createElement("test1").setAttributeNode(uri1);
    ResourceResolver.registerAtStart(OldResourceResolverSpi.class.getName());
    ResourceResolver resolver=ResourceResolver.getInstance(uri, "test");
    ResourceResolver resolver1=ResourceResolver.getInstance(uri1, "test1");
    ResourceResolver resolver2=ResourceResolver.getInstance(uri1, "test2");
   
    resolver2.resolve(uri1, "test2");   
    resolver.resolve(uri, "test");
    resolver1.resolve(uri1, "test1");
   
   
  };
View Full Code Here

  ResourceResolver.registerAtStart(className);
  Document doc =
        DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  Attr uriAttr = doc.createAttribute("URI");
  uriAttr.setValue("http://www.apache.org");
  ResourceResolver res =
      ResourceResolver.getInstance(uriAttr, "http://www.apache.org");
  try {
      uriAttr.setValue("http://xmldsig.pothole.com/xml-stylesheet.txt");
      res.resolve(uriAttr, null);
  } catch (Exception e) {
      e.printStackTrace();
      fail(uriAttr.getValue()
    + " should be resolvable by the OfflineResolver");
  }
  try {
      uriAttr.setValue("http://www.apache.org");
      res.resolve(uriAttr, null);
      fail(uriAttr.getValue()
    + " should not be resolvable by the OfflineResolver");
  } catch (Exception e) { }
    }
View Full Code Here

        DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  Attr uriAttr = doc.createAttribute("URI");
  String basedir = System.getProperty("basedir");
  String file = "file:" + basedir + "/build.xml";
  uriAttr.setValue(file);
  ResourceResolver res = ResourceResolver.getInstance(uriAttr, file);
  try {
      res.resolve(uriAttr, "");
  } catch (Exception e) {
      fail(e.getMessage());
  }
    }
View Full Code Here

      }
  }

        try {
      String baseURI = context.getBaseURI();
            ResourceResolver apacheResolver =
          ResourceResolver.getInstance(uriAttr, baseURI);
            XMLSignatureInput in = apacheResolver.resolve(uriAttr, baseURI);
      if (in.isOctetStream()) {
          return new ApacheOctetStreamData(in);
      } else {
          return new ApacheNodeSetData(in);
      }
View Full Code Here

        ((Element)doc.createElement("test")).setAttributeNode(uri);
        Attr uri1 = doc.createAttribute("id");
        uri1.setNodeValue("!!!test=2");
        doc.createElement("test1").setAttributeNode(uri1);
        ResourceResolver.registerAtStart(OldResourceResolverSpi.class.getName());
        ResourceResolver resolver = ResourceResolver.getInstance(uri, "test");
        ResourceResolver resolver1 = ResourceResolver.getInstance(uri1, "test1");
        ResourceResolver resolver2 = ResourceResolver.getInstance(uri1, "test2");

        resolver2.resolve(uri1, "test2");   
        resolver.resolve(uri, "test");
        resolver1.resolve(uri1, "test1");
    }
View Full Code Here

            "org.apache.xml.security.test.dom.utils.resolver.OfflineResolver";
        ResourceResolver.registerAtStart(className);
        Document doc = XMLUtils.createDocumentBuilder(false).newDocument();
        Attr uriAttr = doc.createAttribute("URI");
        uriAttr.setValue("http://www.apache.org");
        ResourceResolver res =
            ResourceResolver.getInstance(uriAttr, "http://www.apache.org", true);
        try {
            uriAttr.setValue("http://xmldsig.pothole.com/xml-stylesheet.txt");
            res.resolve(uriAttr, null, true);
        } catch (Exception e) {
            e.printStackTrace();
            fail(uriAttr.getValue()
                + " should be resolvable by the OfflineResolver");
        }
        try {
            uriAttr.setValue("http://www.apache.org");
            res.resolve(uriAttr, null, true);
            fail(uriAttr.getValue() + " should not be resolvable by the OfflineResolver");
        } catch (Exception e) {
            //
        }
    }
View Full Code Here

        Document doc = XMLUtils.createDocumentBuilder(false).newDocument();
        Attr uriAttr = doc.createAttribute("URI");
        String basedir = System.getProperty("basedir");
        String file = new File(basedir, "pom.xml").toURI().toString();
        uriAttr.setValue(file);
        ResourceResolver res = ResourceResolver.getInstance(uriAttr, file, false);
        try {
            res.resolve(uriAttr, "", true);
        } catch (Exception e) {
            fail(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.xml.security.utils.resolver.ResourceResolver

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.