Examples of toASCIIString()


Examples of java.net.URI.toASCIIString()

      if(path.startsWith(PLUGINS_PREFIX)) {
        String after = path.substring(PLUGINS_PREFIX.length());
        if(after.indexOf("../") > -1)
          throw new CommentException(l10n("invalidFormURIAttemptToEscape"));
        if(after.matches("[A-Za-z0-9\\.]+"))
          return uri.toASCIIString();
      }
    } catch (URISyntaxException e) {
      throw new CommentException(l10n("couldNotParseFormURIWithError", "error", e.getLocalizedMessage()));
    }
    // Otherwise disallow.
View Full Code Here

Examples of java.net.URI.toASCIIString()

   private String encodeSegment(final String segment)
   {
      try
      {
         final URI uri = new URI("http", "localhost", "/" + segment, null);
         return uri.toASCIIString().substring(17);
      }
      catch (URISyntaxException e)
      {
         throw new IllegalArgumentException(e);
      }
View Full Code Here

Examples of java.net.URI.toASCIIString()

    protected HttpRequestBase createMethod(Exchange exchange) throws Exception {
        // creating the url to use takes 2-steps
        String url = HttpHelper.createURL(exchange, getEndpoint());
        URI uri = HttpHelper.createURI(exchange, url, getEndpoint());
        // get the url from the uri
        url = uri.toASCIIString();

        // execute any custom url rewrite
        String rewriteUrl = HttpHelper.urlRewrite(exchange, url, getEndpoint(), this);
        if (rewriteUrl != null) {
            // update url and query string from the rewritten url
View Full Code Here

Examples of java.net.URI.toASCIIString()

        for (Person userEntity : allUsers) {
            UriBuilder ub = uriInfo.getAbsolutePathBuilder();
            URI userUri = ub.
                    path(userEntity.getUserName()).
                    build();
            uriArray.put(userUri.toASCIIString());
        }
        return uriArray;

  }
View Full Code Here

Examples of java.net.URI.toASCIIString()

      String proxy = YarnConfiguration.getProxyHostAndPort(conf);
      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(HttpConfig.getSchemePrefix().length());
    } catch (URISyntaxException e) {
      LOG.warn("Could not proxify "+trackingUriWithoutScheme,e);
      return trackingUriWithoutScheme;
    } finally {
      this.readLock.unlock();
View Full Code Here

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

Examples of java.net.URI.toASCIIString()

                "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

Examples of java.net.URI.toASCIIString()

  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

Examples of java.net.URI.toASCIIString()

        }
       
        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

Examples of java.net.URI.toASCIIString()

        }
       
        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
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.