Package java.net

Examples of java.net.URI.toASCIIString()


                "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

  public void writeURIAttribute(final String name, final Object value, final String property)
      throws IOException {
    if (value != null) {
      final URI uri = URI.create(value.toString());
      writeAttribute(name, uri.toASCIIString(), property);
    }
  }

// interface TobagoResponseWriter //////////////////////////////////////////////////////////////////////////////////
View Full Code Here

        }
       
        dispatchUri = selectDispatchUri(endpoint, exchange);
       
        if (exchange.getPattern() == ExchangePattern.InOnly) {
            reply = producer.send(dispatchUri.toASCIIString(), exchange);
        } else {
            reply = issueRequest(endpoint, ExchangePattern.InOut, exchange.getIn().getBody(), exchange.getIn().getHeaders());
        }

        return reply;
View Full Code Here

        }
       
        dispatchUri = selectDispatchUri(endpoint, exchange);
       
        if (exchange.getPattern() == ExchangePattern.InOnly) {
            producer.asyncSend(dispatchUri.toASCIIString(), exchange);
            reply = exchange;
        } else {
            Future<Exchange> future = producer.asyncCallback(dispatchUri.toASCIIString(), exchange, new SynchronizationAdapter());
            reply = future.get(endpoint.getConfig().getConnectionTimeout(), TimeUnit.MILLISECONDS);
        }
View Full Code Here

       
        if (exchange.getPattern() == ExchangePattern.InOnly) {
            producer.asyncSend(dispatchUri.toASCIIString(), exchange);
            reply = exchange;
        } else {
            Future<Exchange> future = producer.asyncCallback(dispatchUri.toASCIIString(), exchange, new SynchronizationAdapter());
            reply = future.get(endpoint.getConfig().getConnectionTimeout(), TimeUnit.MILLISECONDS);
        }
       
        return reply;
    }
View Full Code Here

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

        String method = getMethod();
        ProtocolVersion ver = getProtocolVersion();
        URI uri = getURI();
        String uritext = null;
        if (uri != null) {
            uritext = uri.toASCIIString();
        }
        if (uritext == null || uritext.length() == 0) {
            uritext = "/";
        }
        return new BasicRequestLine(method, uritext, ver);
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

        String method = getMethod();
        ProtocolVersion ver = getProtocolVersion();
        URI uri = getURI();
        String uritext = null;
        if (uri != null) {
            uritext = uri.toASCIIString();
        }
        if (uritext == null || uritext.length() == 0) {
            uritext = "/";
        }
        return new BasicRequestLine(method, uritext, ver);
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.