Package org.apache.xml.utils

Examples of org.apache.xml.utils.URI


         boolean switchBackProxy = ((oldProxySet != null)
                                    && (oldProxyHost != null)
                                    && (oldProxyPort != null));

         // calculate new URI
         URI uriNew = getNewURI(uri.getNodeValue(), BaseURI);

         // if the URI contains a fragment, ignore it
         URI uriNewNoFrag = new URI(uriNew);

         uriNewNoFrag.setFragment(null);

         URL url = new URL(uriNewNoFrag.toString());
         URLConnection urlConnection = url.openConnection();

         {

            // set proxy pass
View Full Code Here


   private URI getNewURI(String uri, String BaseURI)
           throws URI.MalformedURIException {

      if ((BaseURI == null) || "".equals(BaseURI)) {
         return new URI(uri);
      }
      return new URI(new URI(BaseURI), uri);
   }
View Full Code Here

    public static File getFileFromUrls(String[] urls) {
        for (int i = 0; i < urls.length; i++) {
            String urlStr = urls[i];
            if (urlStr != null) {
                if (urlStr.startsWith("file:")) {
                    URI uri;
                    try {
                        uri = new URI(urlStr);
                        urlStr = uri.getPath();
                    } catch (MalformedURIException e) {
                        // do nothing
                    }
                }
                File fontFile = new File(urlStr);
View Full Code Here

        }

        XMLSignatureInput result = new XMLSignatureInput(selectedElem);
        result.setMIMEType("text/xml");
        try {
            URI uriNew = new URI(new URI(BaseURI), uri.getNodeValue());
            result.setSourceURI(uriNew.toString());
        } catch (URI.MalformedURIException ex) {
            result.setSourceURI(BaseURI);
        }
        if (doDebug) {
            log.debug("exit engineResolve, result: " + result);
View Full Code Here

        }

        XMLSignatureInput result = new XMLSignatureInput(selectedElem);
        result.setMIMEType("text/xml");
        try {
            URI uriNew = new URI(new URI(BaseURI), uri.getNodeValue());
            result.setSourceURI(uriNew.toString());
        } catch (URI.MalformedURIException ex) {
            result.setSourceURI(BaseURI);
        }
        if (doDebug) {
            log.debug("exit engineResolve, result: " + result);
View Full Code Here

            public String getTarget() {
                return (target);
            }
            /** @inheritDoc */
            public void setTarget(String target) {
                URI tmpTarget = null;
                try {
                    tmpTarget = new URI(target);
                } catch (URI.MalformedURIException mfue) {
                    // complain
                }
                this.target = tmpTarget.toString();
            }
View Full Code Here

      if (uriNodeValue.equals("") || uriNodeValue.startsWith("#")) {
         return false;
      }

      try {
         URI uriNew = new URI(new URI(BaseURI), uri.getNodeValue());

         if (uriNew.getScheme().equals("http")) {
            cat.debug("I state that I can resolve " + uriNew.toString());

            return true;
         }

         cat.debug("I state that I can't resolve " + uriNew.toString());
      } catch (URI.MalformedURIException ex) {}

      return false;
   }
View Full Code Here

         return systemId;
      }

      // if id already expanded, return
      try {
         URI url = new URI(id);

         if (url != null) {
            return systemId;
         }
      } catch (Exception e) {

         // continue on...
      }

      // normalize id
      id = ResourceResolverSpi.fixURI(id);

      // normalize base
      URI base = null;
      URI url = null;

      try {
         if (currentSystemId == null) {
            String dir;

            try {
               dir = ResourceResolverSpi.fixURI(System.getProperty("user.dir"));
            } catch (SecurityException se) {
               dir = "";
            }

            if (!dir.endsWith("/")) {
               dir = dir + "/";
            }

            final String protocol = "file";
            final String host = "";

            base = new URI(protocol, host, dir, null, null);
         } else {

            // should we fix currentSystemId?
            currentSystemId = ResourceResolverSpi.fixURI(currentSystemId);
            base = new URI(currentSystemId);
         }

         // expand id
         url = new URI(base, id);
      } catch (Exception e) {

         // let it go through
      }

      if (url == null) {
         return systemId;
      }

      return url.toString();
   }
View Full Code Here

                return (algorithmURI);
            }

            /** @param algorithm*/
            public void setAlgorithm(String algorithm) {
                URI tmpAlgorithm = null;
                try {
                    tmpAlgorithm = new URI(algorithm);
                } catch (URI.MalformedURIException mfue) {
                    //complain
                }
                algorithm = tmpAlgorithm.toString();
            }
View Full Code Here

            /**
             *
             * @param type
             */
            public void setType(String type) {
                URI tmpType = null;
                try {
                    tmpType = new URI(type);
                } catch (URI.MalformedURIException mfue) {
                    // complain
                }
                this.type = tmpType.toString();
            }
View Full Code Here

TOP

Related Classes of org.apache.xml.utils.URI

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.