Package java.net

Examples of java.net.URI.toASCIIString()


                }
            }
        }
       
        if (LOG.isDebugEnabled()) {
            LOG.debug("Dispatch URI set to: " + dispatchUri.toASCIIString());
        }
       
        return dispatchUri;
    }
   
View Full Code Here


        UriBuilder uriBuilder = UriBuilder.fromPath("");
        uriBuilder.path("{w}");
        Map<String, String> values = new HashMap<String, String>();
        values.put("w", "somerootlesspath");
        URI uri = uriBuilder.buildFromEncodedMap(values);
        assertEquals("somerootlesspath", uri.toASCIIString());

        uriBuilder = UriBuilder.fromPath("{w}");
        values = new HashMap<String, String>();
        values.put("w", "somerootlesspath");
        uri = uriBuilder.buildFromEncodedMap(values);
View Full Code Here

        uriBuilder = UriBuilder.fromPath("{w}");
        values = new HashMap<String, String>();
        values.put("w", "somerootlesspath");
        uri = uriBuilder.buildFromEncodedMap(values);
        assertEquals("somerootlesspath", uri.toASCIIString());
    }

    public void testQueryIllegal() {
        UriBuilder uriBuilder = UriBuilder.fromPath("");
        try {
View Full Code Here

      try {
        XMLReader reader = XMLParserUtils.getXMLReader();
        reader.setContentHandler(_mch);
        reader.setFeature("http://xml.org/sax/features/namespaces", true);
        reader.setEntityResolver(_resolver);
        reader.parse(x.toASCIIString());
        _references.put(x, new HashSet<URI>(refs));
      } catch (Exception e) {
        _errors.put(x, e);
      }
View Full Code Here

                "incorrect toString()",
                "ht12-3+tp:///p%23a%25E2%2582%25ACth?q%5Eu%2525ery#f/r\u00dfag",
                uri.toString());
        assertEquals("incorrect toASCIIString()",

        "ht12-3+tp:///p%23a%25E2%2582%25ACth?q%5Eu%2525ery#f/r%C3%9Fag", uri
                .toASCIIString());
    }

    /**
     * @throws URISyntaxException
View Full Code Here

                "http://www.test.com/%E2%82%AC/dir/file#fragment",
                "mailto://user@domain.com", "mailto://user%C3%9F@domain.com", };

        for (int i = 0; i < toASCIIStringData.length; i++) {
            URI test = new URI(toASCIIStringData[i]);
            String result = test.toASCIIString();
            assertTrue("Error: new URI(\"" + toASCIIStringData[i]
                    + "\").toASCIIString() returned: " + result
                    + ", expected: " + toASCIIStringResults[i], result
                    .equals(toASCIIStringResults[i]));
        }
View Full Code Here

        // create new uri with the parameters
        URI out = URISupport.createRemainingURI(new URI(uri), map);
        assertNotNull(out);
        assertEquals("http://localhost:23271/myapp/mytest?foo=abc+def&bar=123%2C456&name=S%C3%B8ren", out.toString());
        assertEquals("http://localhost:23271/myapp/mytest?foo=abc+def&bar=123%2C456&name=S%C3%B8ren", out.toASCIIString());
    }

    public void testNormalizeEndpointUriWithDualParameters() throws Exception {
        String out1 = URISupport.normalizeUri("smtp://localhost?to=foo&to=bar&from=me");
        assertEquals("smtp://localhost?from=me&to=foo&to=bar", out1);
View Full Code Here

    private void appendResponses(List<PropFindResponse> responses, PropFindableResource resource, int requestedDepth, PropFindRequestFieldParser.ParseResult parseResult, String encodedCollectionUrl) {
        try {
            String collectionHref = suffixSlash(resource, encodedCollectionUrl);
            URI parentUri = new URI(collectionHref);

            collectionHref = parentUri.toASCIIString();
            processResource(responses, resource, parseResult, collectionHref, requestedDepth, 0, collectionHref);

        } catch (URISyntaxException ex) {
            throw new RuntimeException(ex);
        }
View Full Code Here

     *@param policyFile the file containing additional policy
     */
    public static void refreshPolicy(File policyFile) {
        int idx = firstFreePolicyIndex();
        URI policyFileURI = policyFile.toURI();
        java.security.Security.setProperty("policy.url." + idx, policyFileURI.toASCIIString());
        Policy p = Policy.getPolicy();
        p.refresh();
    }
   
    /**
 
View Full Code Here

        ProxyUriUtils.getUriFromAMUrl(trackingUriWithoutScheme);
      URI proxyUri = ProxyUriUtils.getUriFromAMUrl(proxy);
      URI result = ProxyUriUtils.getProxyUri(trackingUri, proxyUri,
          applicationAttemptId.getApplicationId());
      //We need to strip off the scheme to have it match what was there before
      return result.toASCIIString().substring(7);
    } catch (URISyntaxException e) {
      LOG.warn("Could not proxify "+trackingUriWithoutScheme,e);
      return trackingUriWithoutScheme;
    } finally {
      this.readLock.unlock();
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.